MB-21539: Address raciness / intermittent timeout in test_mb16357 85/70085/7
authorDave Rigby <daver@couchbase.com>
Fri, 18 Nov 2016 15:29:52 +0000 (15:29 +0000)
committerDave Rigby <daver@couchbase.com>
Mon, 21 Nov 2016 15:45:53 +0000 (15:45 +0000)
commit8b7ee5ae70fb5fff85aa108994caab2ecd5b1d06
tree01b69afa8ad2277fec9db8badb93d3c37069956b
parent3682f843279238ba1b045db205b296de141c72f8
MB-21539: Address raciness / intermittent timeout in test_mb16357

This is a multithreaded test which attempts to run the compactor
concurrently with a DCP stream when a vBucket flips to
replica. However, there is no interlocking of the threads' startup,
which can result in the compaction running and completing before the
DCP thread reaches line 810 (where it busy-waits for
ep_pending_compactions != 0). As a result the test can get stuck at
that line and timeout.

Address this by introducing synchronisation between the two threads -
ensure that the compactor thread is ready and about to compact before
advancing the DCP thread.

Change-Id: Icc5abb3080a981823bb2161d083f0d866364b76e
Reviewed-on: http://review.couchbase.org/70085
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Jim Walker <jim@couchbase.com>
tests/ep_testsuite_dcp.cc