In some scenarios, the io complete notification reached before we start
waiting for it via the condition variable. This results in the test
hanging forever. Now we track the no.of notifications and wait
accordingly
Change-Id: Id9d9404892e111d7d60760d0e9ce727b474c0997
Reviewed-on: http://review.couchbase.org/78508
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: Build Bot <build@couchbase.com>
bool pending_marker_ack = false;
uint64_t marker_end = 0;
uint64_t num_mutations = 0;
+ uint64_t num_io_processed = 0;
+ struct mock_connstruct* c = nullptr;
+
std::unique_ptr<dcp_message_producers> producers(get_dcp_producers(h, h1));
do {
the api expects the cookie to be locked before
calling it */
wait_started = true;
- testHarness.waitfor_cookie(cookie);
+ c = (struct mock_connstruct*)cookie;
+ if (num_io_processed == c->num_io_notifications) {
+ testHarness.waitfor_cookie(cookie);
+ }
+ num_io_processed = c->num_io_notifications;
testHarness.unlock_cookie(cookie);
break;
default: