use of org.neo4j.kernel.impl.transaction.log.rotation.monitor.LogRotationMonitor in project neo4j by neo4j.
the class TestStartTransactionDuringLogRotation method setUp.
@BeforeEach
void setUp() throws InterruptedException {
executor = Executors.newCachedThreadPool();
startLogRotationLatch = new CountDownLatch(1);
completeLogRotationLatch = new CountDownLatch(1);
writerStopped = new AtomicBoolean();
LogRotationMonitor rotationListener = new LogRotationMonitorAdapter() {
@Override
public void startRotation(long currentLogVersion) {
startLogRotationLatch.countDown();
try {
completeLogRotationLatch.await();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
};
monitors.addMonitorListener(rotationListener);
label = Label.label("Label");
rotationFuture = t2.execute(forceLogRotation(database));
// Waiting for the writer task to start a log rotation
startLogRotationLatch.await();
// Then we should be able to start a transaction, though perhaps not be able to finish it.
// This is what the individual test methods will be doing.
// The test passes when transaction.close completes within the test timeout, that is, it didn't deadlock.
}
Aggregations