mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-07 23:09:32 +02:00
Ensure that the testlogger has its final test removal safely (#16907)
It is possible to get a data race right at the end of the TestMain in integrations during the final removal of the test from the testlogger. This PR uses a Reset function to remove any final tests but adds some extra logging which will forcibly fail if there is an unclosed logger. Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
1 parent
de2e96e37b
commit
6e0e414f55
2 files changed
+16
-1
No files matched your search
@@ -120,7 +120,7 @@ func TestMain(m *testing.M) {
|
||||
}
|
||||
exitCode := m.Run()
|
||||
|
||||
writerCloser.t = nil
|
||||
writerCloser.Reset()
|
||||
|
||||
if err = util.RemoveAll(setting.Indexer.IssuePath); err != nil {
|
||||
fmt.Printf("util.RemoveAll: %v\n", err)
|
||||
|
||||
Reference in new issue
Block a user