diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-09-22 12:44:36 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-10-06 08:47:00 +0300 |
commit | 21bbf22b3b2de22c6dcd873b20cb0c4f91750cf2 (patch) | |
tree | 2e8e5d45915c903f65b4d56eba8063417361673b | |
parent | c7458405f369c07f77760aa72c69211c5f55bdf2 (diff) |
catfile: Test for Goroutine leaks
A recent refactoring of the catfile cache has caused an incident via a
new Goroutine leak. Assert that we do not leak any Goroutines via
`MustHaveNoGoroutines()` now that the leak has been plugged such that we
cannot have new regressions there.
-rw-r--r-- | internal/git/catfile/testhelper_test.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/internal/git/catfile/testhelper_test.go b/internal/git/catfile/testhelper_test.go index d78dc8092..4479adb85 100644 --- a/internal/git/catfile/testhelper_test.go +++ b/internal/git/catfile/testhelper_test.go @@ -17,7 +17,11 @@ func TestMain(m *testing.M) { } func testMain(m *testing.M) int { - defer testhelper.MustHaveNoChildProcess() + defer func() { + testhelper.MustHaveNoChildProcess() + testhelper.MustHaveNoGoroutines() + }() + cleanup := testhelper.Configure() defer cleanup() return m.Run() |