Skip to content

Commit

Permalink
MB-17631: Fix intermittently failing CV test case 'test_est_vb_move'
Browse files Browse the repository at this point in the history
This fix has been checked-in in master branch few weeks ago. The test
occasionally fails in watson branch as well, and this commit will
prevent that.
Here are some more details about underlying problem.
1. Thread A.
Testcase (actually couple of them) fails in
"CouchKVStore::getNumPersistedDeletes" proc right after calling
openDB( ) api with RDONLY mode for bucket 0. It fails because
this call does not complete with success, and the reason is that
couch-db "0.couch.1" file attempted to be opened does not exist,
to be exact has not been created yet, and is not being created in
this call because the api has RDONLY mode.
2. Thread B.
This thread runs "test_setup" proc, as part of which "0.couch.1"
file for bucket 0 should be created. What we do here is schedule
task which will create file "0.couch.1" and without waiting till
it completes start testcase itself in Thread A. And so basically
there is a racing condition between threads A & B. Though request
to schedule task for file "0.couch.1" creation in Thread B happens
before we start testcase in Thread A, this request is not being
completed by the time openDB call is being issued in Thread A.
Code committed with check-in allows to fix the testcase, and in
particularly wait till couch-db file "0.couch.1" will be created,
so testcase can check that the content of this file is correct
(numPersistedDeletes == 0) for bucket 0.

Change-Id: I9573ffb86de770f98c366e13fe2866bd0002df21
Reviewed-on: http://review.couchbase.org/62025
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Chiyoung Seo <chiyoung@couchbase.com>
  • Loading branch information
nkhachiyan authored and chiyoung committed Apr 6, 2016
1 parent 75487f0 commit b929e87
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/ep_testsuite_tap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,7 @@ static enum test_result test_tap_implicit_ack_stream(ENGINE_HANDLE *h, ENGINE_HA

static enum test_result test_est_vb_move(ENGINE_HANDLE *h,
ENGINE_HANDLE_V1 *h1) {
wait_for_stat_change(h, h1, "ep_db_file_size", 0); // wait couch db creation
check(estimateVBucketMove(h, h1, 0) == 0, "Empty VB estimate is wrong");

const int num_keys = 5;
Expand Down

0 comments on commit b929e87

Please sign in to comment.