Skip to content

operations: Fix misuse of UserMergeBranch

Patrick Steinhardt requested to merge pks-operations-merge-misuse-race into master

The UserMergeBranch RPC is used to merge two commits with each other. The RPC works in two phases: first, the merge commit is computed and sent to the caller. And then, if the caller is happy with the results, they would send a "apply" message which causes us to actually update the target reference to point to that merged commit. We're doing this wrong in one of our tests though: we send both requests in quick succession without first waiting for the initial answer.

This seems to work alright in the general case, but we've infrequently seen that there are flakes in this test. The symptom is that something is still writing data into the repository, and we thus fail to delete it after the test. I'm honestly not clear on how this can happen, but fixing the abuse of the API is a good first step. Also, running the test in a tight loop for 10 minutes did surface the bug after about one minute without this change, but it didn't trigger the bug after more than 10 minutes with this change.

So let's hopefully fix the flake by sending messages in the correct order.

Fixes #3900 (closed).

Merge request reports