Skip to content

Commit 178f503

Browse files
committed
WIP comments about timeouts
1 parent 8a3627b commit 178f503

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

bosk-mongo/src/test/java/works/bosk/drivers/mongo/internal/MongoDriverRecoveryTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ void initialOutage_recovers() throws InvalidTypeException, InterruptedException,
114114
tearDownActions.add(()->mongoService.restoreConnection());
115115

116116
LOGGER.debug("Create a new bosk that can't connect");
117+
// This takes 4x the timescale:
118+
// - 2*timescale: ChangeReceiver initial connection fails
119+
// - 2*timescale: Doomed attempt to read initial state
117120
Bosk<TestEntity> bosk = new Bosk<>(getClass().getSimpleName() + boskCounter.incrementAndGet(), TestEntity.class, AbstractMongoDriverTest::initialRoot, BoskConfig.<TestEntity>builder().driverFactory(driverFactory).build());
118121
LOGGER.debug("Done creating bosk");
119122

@@ -127,6 +130,9 @@ void initialOutage_recovers() throws InvalidTypeException, InterruptedException,
127130
}
128131

129132
LOGGER.debug("Verify that driver operations throw");
133+
// This takes 10x timescale to fail. Each operation takes 5x the timescale
134+
// because the driver is disconnected and it times out waiting for recovery.
135+
// The operations themselves fail immediately because it's disconnected.
130136
assertThrows(FlushFailureException.class, driver::flush,
131137
"Flush disallowed during outage");
132138
assertThrows(Exception.class, () -> driver.submitReplacement(bosk.rootReference(), initialRoot(bosk)),

0 commit comments

Comments
 (0)