Skip to content

Fix flaky TransactionManager test

Sami Hiltunen requested to merge smh-fix-txn-mgr-flake into master

TestTransactionManager/continues_processing_after_a_restart is may currently flake. The test case is testing that the transaction processing will successfully continue after a restart.

The problem is that while the first transaction in the test case can be succesfully committed and logged, it may not be applied yet by the time the transaction manager is stopped in the test. The test then flakes if the application is in progress when the manager is being stopped and the git process updating the references gets terminated. This may then lead to stale reference locks being left on the disk by git which then prevents reapplying the log entry after a restart.

While this will be fixed eventually in the production code by cleaning up stale lock files that are encountered during log processing, for now, prevent the flakiness in the test by synchronizing the manager prior to stopping the manager. This ensures the log entry has been applied before stopping the manager which avoids the chance of terminating git while applying the log entry and leaving stale locks on the disk.

Closes #5131 (closed)
Caused by lack of #4736 (closed)

Edited by Sami Hiltunen

Merge request reports