v.io/x/ref/services/syncbase/vsync: fix flaky TestBlobFetchSimple
I had two errors in TestBlobFetchSimple.
First, it was flaky because I ran two test phases back to back using the same
set of 100 blob ids. The code determines when the first phase is over
when its fake flob fetch routine decrements a test-local counter to zero.
But there can be a delay between that routine decrementing its counter,
and the routine returning to the blob fetching code, which then must record the
blob as having been fetched successfully.
If the second phase starts while there are still fetches that have completed,
but not yet been recorded, the blob fetcher's duplicate elimination
will come into play, and unexpectedly ignore some blob fetch requests from the
second phase. This is now fixed by creating new blob ids for each phase.
Second, I was failing to shutdown the vsync test framework correctly.
I now call vsync.destroyService().
1 file changed