MB-19501: ep_test_apis.cc: Wait for outstanding flushers to complete
MB-19501: ep_test_apis.cc: Wait for outstanding flushers to complete

There is an issue in how the testsuites wait for items to be flushed
to disk when in full eviction mode, which results in intermittent test
failures are the item count (curr_items) is under-reported.

The issue is that we only wait for the {{ep_queue_size}} stat to be
zero (assuming that means that all items are now on disk), however in
the case of full eviction we need to update the count of how many
items are in a vBucket (HashTable) based on how many are now on disk;
with is done after the disk commit - see
EventuallyPersistentStore::commit().

We also need to to wait for any outstanding flushes to disk to
complete - specifically so when in full eviction mode we have waited
for the item counts in each vBucket to be synced with the number of
items on disk.

Change-Id: Ibbffddd137fc17f1dfe80edcc35e177ee6915763
Reviewed-on: http://review.couchbase.org/63710
Reviewed-by: Will Gardner <cbd6f5d9092d9ef7d5c0510d53bba134b22c02f2@couchbase.com>
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>

daverigby/ep-engine,daverigby/ep-engine,teligent-ru/ep-engine,membase/ep-engine,daverigby/ep-engine,daverigby/kv_engine,membase/ep-engine,hisundar/ep-engine,membase/ep-engine,membase/ep-engine,teligent-ru/ep-engine,hisundar/ep-engine,owendCB/ep-engine,daverigby/ep-engine,daverigby/kv_engine,hisundar/ep-engine,daverigby/kv_engine,owendCB/ep-engine,couchbase/ep-engine,teligent-ru/ep-engine,teligent-ru/ep-engine,daverigby/kv_engine,hisundar/ep-engine,owendCB/ep-engine,couchbase/ep-engine,couchbase/ep-engine,couchbase/ep-engine,owendCB/ep-engine