This unit test is failing on jenkins quite often due to a timing issue
with the tests resulting from recent changes. Basically akka uses a
calling thread dispatcher by default so the call to
createSnapshotProcedure in the SnapshotManager may result in a direct
call to persist which fails b/c it's still in the Idle state. Moving the
setting of currentState to CREATING prior to calling
createSnapshotProcedure fixes the issue.
Change-Id: If68333d042896e25fd3f85dd16da7b84ca56d944
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
LOG.debug("lastSequenceNumber prior to capture: {}", lastSequenceNumber);
+ SnapshotManager.this.currentState = CREATING;
+
try {
createSnapshotProcedure.apply(null);
} catch (Exception e) {
+ SnapshotManager.this.currentState = IDLE;
LOG.error("Error creating snapshot", e);
return false;
}
- SnapshotManager.this.currentState = CREATING;
return true;
}