Skip to content

hook: Fix pack-objects hook test with context cancellation

One of our tests for the pack-objects hook exercises what happens when the context of the original Goroutine that created a cache entry gets cancelled. The logic to do this is really hard to follow though as there are multiple contexts, streams and waiters, and neither of them are well encapsulated. Furthermore, there are some issues with lack of synchronization and an invalid setup that may cause the git-pack-objects(1) process to exit earlier than we assume in the test.

This MR addresses all of those issues to hopefully fix the flake.

Closes [Flaky Test] TestServer_PackObjectsHook_separat... (#5548 - closed).

Merge request reports