diff options
author | Rowan Bohde <rowan.bohde@gmail.com> | 2024-11-14 13:28:46 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-14 19:28:46 +0000 |
commit | 68731c07c52d35b7b44db1c2f5f7a755efcc8c84 (patch) | |
tree | 5357aca5db9027ec978f561c65a496810cb72517 /modules/testlogger | |
parent | 249e67672aea8a5a0ed73bedc655f9dcd37437ea (diff) | |
download | gitea-68731c07c52d35b7b44db1c2f5f7a755efcc8c84.tar.gz gitea-68731c07c52d35b7b44db1c2f5f7a755efcc8c84.zip |
Reduce integration test overhead (#32475)
In profiling integration tests, I found a couple places where per-test
overhead could be reduced:
* Avoiding disk IO by synchronizing instead of deleting & copying test
Git repository data. This saves ~100ms per test on my machine
* When flushing queues in `PrintCurrentTest`, invoke `FlushWithContext`
in a parallel.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'modules/testlogger')
-rw-r--r-- | modules/testlogger/testlogger.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/testlogger/testlogger.go b/modules/testlogger/testlogger.go index 9a54d63f20..2bc3984ed6 100644 --- a/modules/testlogger/testlogger.go +++ b/modules/testlogger/testlogger.go @@ -118,7 +118,7 @@ func PrintCurrentTest(t testing.TB, skip ...int) func() { _, _ = fmt.Fprintf(os.Stdout, "+++ %s ... still flushing after %v ...\n", t.Name(), SlowFlush) } }) - if err := queue.GetManager().FlushAll(context.Background(), time.Minute); err != nil { + if err := queue.GetManager().FlushAll(context.Background(), -1); err != nil { t.Errorf("Flushing queues failed with error %v", err) } timer.Stop() |