java/syncbase: Fix potentially flaky test.
Watch test had a potential race condition (seen in Mojo) where the
initial scan is delayed to the point of containing values put after
starting the watch.
Change-Id: I808b009bda2a6a203b3d6691786b9208c03c806a
diff --git a/lib/src/test/java/io/v/v23/syncbase/SyncbaseTest.java b/lib/src/test/java/io/v/v23/syncbase/SyncbaseTest.java
index 10ae922..089cef8 100644
--- a/lib/src/test/java/io/v/v23/syncbase/SyncbaseTest.java
+++ b/lib/src/test/java/io/v/v23/syncbase/SyncbaseTest.java
@@ -283,14 +283,17 @@
Iterator<WatchChange> it = InputChannels.asIterable(
db.watch(ctxC, TABLE_NAME, "b")).iterator();
+ ImmutableList<WatchChange> expectedInitialChanges = ImmutableList.of(
+ new WatchChange(TABLE_NAME, "bar", ChangeType.PUT_CHANGE,
+ VomUtil.encode(bar, Bar.class), null, false, true),
+ new WatchChange(TABLE_NAME, "barfoo", ChangeType.PUT_CHANGE,
+ VomUtil.encode(foo, Foo.class), null, false, false));
+ checkWatch(it, expectedInitialChanges);
+
sync(table.put(ctx, "baz", baz, Baz.class));
sync(table.getRow("baz").delete(ctx));
ImmutableList<WatchChange> expectedChanges = ImmutableList.of(
- new WatchChange(TABLE_NAME, "bar", ChangeType.PUT_CHANGE,
- VomUtil.encode(bar, Bar.class), null, false, true),
- new WatchChange(TABLE_NAME, "barfoo", ChangeType.PUT_CHANGE,
- VomUtil.encode(foo, Foo.class), null, false, false),
new WatchChange(TABLE_NAME, "baz", ChangeType.PUT_CHANGE,
VomUtil.encode(baz, Baz.class), null, false, false),
new WatchChange(TABLE_NAME, "baz", ChangeType.DELETE_CHANGE,