Skip to content

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.

perf(tests): replace panic with os.Exit in TestMain for graceful test termination

Sonui4175b06039e3
diff --git a/plugin/plugin_test/plugin_main_test.go b/plugin/plugin_test/plugin_main_test.go
index 4f92bebe..add11460 100644
--- a/plugin/plugin_test/plugin_main_test.go
+++ b/plugin/plugin_test/plugin_main_test.go
@@ -92,7 +92,7 @@ func TestMain(t *testing.M) {
log.Info("init test database successfully")
if ret := t.Run(); ret != 0 {
- panic(ret)
+ os.Exit(ret)
}
}