MCPcopy Index your code
hub / github.com/ccxt/ccxt / testRace

Method testRace

java/lib/src/test/java/io/github/ccxt/ws/FutureTest.java:52–64  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

50 }
51
52 @Test
53 @Timeout(5)
54 void testRace() throws Exception {
55 Future f1 = new Future();
56 Future f2 = new Future();
57 Future f3 = new Future();
58
59 Future winner = Future.race(f1, f2, f3);
60 assertFalse(winner.isDone());
61
62 f2.resolve("second wins");
63 assertEquals("second wins", winner.getFuture().get(1, TimeUnit.SECONDS));
64 }
65
66 @Test
67 @Timeout(5)

Callers

nothing calls this directly

Calls 5

raceMethod · 0.95
isDoneMethod · 0.95
resolveMethod · 0.95
getFutureMethod · 0.95
getMethod · 0.45

Tested by

no test coverage detected