Skip to content

Commit 815202e

Browse files
committed
Merge pull request #518 from basho/zl/test-fix/fix-regression-yz_schema_admin-develop
fix regression yz schema admin... already merged into 2.0 Reviewed-by: cmeiklejohn
2 parents 463b53d + d31ec4f commit 815202e

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

include/yokozuna.hrl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,8 @@
130130

131131
-define(DATA_DIR, application:get_env(riak_core, platform_data_dir)).
132132

133-
-define(DEFAULT_IDX_CREATE_TIMEOUT, 60000).
133+
%% Default timeout for index (put) creation.
134+
-define(DEFAULT_IDX_CREATE_TIMEOUT, 45000).
134135

135136
-define(MAYBE(Check, Expression, Default),
136137
case Check of

riak_test/yz_schema_admin.erl

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,7 @@ confirm_bad_schema(Cluster) ->
370370
lager:info("create ~s index using bad ~s schema", [Name, Name]),
371371
{ok, Status2, _, _} = http(put, URL2, Headers2, mochijson2:encode(Body)),
372372
%% This should return 204 because it simply adds an entry to the
373-
%% ring. The actual Solr Core creation is async.
374-
?assertEqual("204", Status2),
375-
376-
lager:info("give solr time to attempt to create core ~s", [Name]),
377-
timer:sleep(5000),
378-
lager:info("verify solr core ~s is not up", [Name]),
379-
?assertEqual(yz_solr:ping(Name), error),
373+
?assertEqual("400", Status2),
380374

381375
lager:info("upload corrected schema ~s", [Name]),
382376
{ok, Status3, _, _} = http(put, URL, Headers, ?TEST_SCHEMA),
@@ -387,7 +381,12 @@ confirm_bad_schema(Cluster) ->
387381
lager:info("try to ping core ~s", [Name]),
388382
rpc:call(Node2, yz_solr, ping, [Name])
389383
end,
390-
yz_rt:wait_until(Cluster, F).
384+
yz_rt:wait_until(Cluster, F),
385+
386+
lager:info("create ~s index using good ~s schema", [Name, Name]),
387+
{ok, Status4, _, _} = http(put, URL2, Headers2, mochijson2:encode(Body)),
388+
%% This should return 204 because it simply adds an entry to the
389+
?assertEqual("204", Status4).
391390

392391
%% @doc Confirm that creating a new shema gets added to the
393392
%% cluster metadata as a compressed blob, and is retrievable

0 commit comments

Comments
 (0)