Skip to content

storagemgr: Fix flaky transaction begin with context cancellation

In 090bd71c (storagemgr: Fix flaky test when committing with cancelled context, 2023-08-31), we have fixed a flake that occurred when we try to commit a transaction with an already-cancelled context. The same flake now also happens in a different testcase, where we exercise that context cancellation can indeed cancel beginning a transaction. And indeed, the root cause is the same, where we use selects over multiple channels and thus effectively pick at random whether we honor context cancellation or not.

Let's also fix the test in the same way by causing the transaction to block. This time around, we can achieve this by setting up an "apply" notification channel.

Closes [Flaky Test] TestPartitionManager/starting_tran... (#5585 - closed).

Merge request reports