Skip to content

Commit 00d3c9f

Browse files
committed
Update tests
1 parent 8effa3a commit 00d3c9f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

convex-peer/src/test/java/convex/node/LatticePropagatorTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import convex.core.data.Index;
2020
import convex.core.data.Keyword;
2121
import convex.core.data.prim.CVMLong;
22+
import convex.core.lang.RT;
2223
import convex.core.store.AStore;
2324
import convex.core.store.MemoryStore;
2425
import convex.lattice.ALattice;
@@ -103,6 +104,7 @@ public void testPropagatorAutoStart() {
103104
* 1. The propagator detects value changes
104105
* 2. The propagator broadcasts to connected peers
105106
* 3. Broadcasts are sent automatically without manual intervention
107+
* 4. broadcast value is successfully obtained
106108
*/
107109
@Test
108110
public void testAutomaticPropagation() throws Exception {
@@ -128,7 +130,7 @@ public void testAutomaticPropagation() throws Exception {
128130
server2.updateLocalPath(updatedDataIndex, dataKeyword);
129131

130132
// Wait for propagator to detect change and broadcast (up to 1 second)
131-
TimeUnit.MILLISECONDS.sleep(500);
133+
server1.sync();
132134

133135
// Verify propagator detected the change and broadcasted
134136
long finalBroadcastCount = server2.getPropagator().getBroadcastCount();
@@ -138,6 +140,8 @@ public void testAutomaticPropagation() throws Exception {
138140
// Verify the broadcast count increased by at least 1
139141
assertTrue((finalBroadcastCount - initialBroadcastCount) >= 1,
140142
"At least one broadcast should have been sent after value change");
143+
144+
assertEquals(testValue,RT.getIn(server1.getLocalValue(),dataKeyword,valueHash));
141145
}
142146

143147
/**

0 commit comments

Comments
 (0)