Skip to content

Commit

Permalink
MB-100 Fix race condition in test 02-old-index-cleanup.t
Browse files Browse the repository at this point in the history
Change-Id: I769a3ee0a8bddc0de873b6a282dd85fc58d7a7a8
Reviewed-on: http://review.couchbase.org/20245
Reviewed-by: Filipe David Borba Manana <fdmanana@gmail.com>
Tested-by: Filipe David Borba Manana <fdmanana@gmail.com>
  • Loading branch information
fdmanana committed Aug 28, 2012
1 parent 2deb6fd commit ca8eb92
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/couch_set_view/test/02-old-index-cleanup.t
Expand Up @@ -25,7 +25,7 @@ num_docs() -> 1000.
main(_) ->
test_util:init_code_path(),

etap:plan(70),
etap:plan(71),
case (catch test()) of
ok ->
etap:end_tests();
Expand Down Expand Up @@ -96,7 +96,10 @@ test() ->
"Old index file deleted before cleanup because group was updated"),

couch_util:shutdown_sync(NewGroupPid),
% Let couch_set_view process group process EXIT message
ok = timer:sleep(1000),
NewGroupPid2 = couch_set_view:get_group_pid(test_set_name(), ddoc_id()),
etap:isnt(NewGroupPid2, NewGroupPid, "Got different group pid"),
AllIndexFiles2 = all_index_files(),
etap:is(lists:member(NewIndexFile, AllIndexFiles2), true,
"New index file found after group process restart"),
Expand Down

0 comments on commit ca8eb92

Please sign in to comment.