Open
Description
Problem
The current TestMain
function in tests/bridge_test.go
calls m.Run()
after a deferred cleanup block, which prevents the deferred functions from executing correctly. This needs to be updated to ensure proper cleanup after the tests finish running.
Code to Fix
The following code is found in tests/test_file.go
, starting at line 47:
func TestMain(m *testing.M) {
defer func() {
if testApps != nil {
testApps.Free()
}
if rollupApp != nil {
rollupApp.Free()
}
}()
m.Run()
}
__________________________________________________________________________________-
Suggested Solution
Move the m.Run() before the defer block, as follows:
func TestMain(m *testing.M) {
code := m.Run() // Call before defer
defer func() {
if testApps != nil {
testApps.Free()
}
if rollupApp != nil {
rollupApp.Free()
}
}()
os.Exit(code) // Properly exits with test results
}
Metadata
Metadata
Assignees
Labels
No labels