You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added a test file main_test.go with the following content:
package main
import"testing"funcTestX(t*testing.T) {
if1!=2 {
t.Fail()
}
}
Then I ran this test file and got the following output (which is fine):
--- FAIL: TestX (0.00s)
FAIL
exit status 1
FAIL github.com/haunt98/go-test-color 0.333s
2022/07/24 14:28:42 Failed to wait: exit status 1
When I added a time.Sleep(2*time.Second) at line 64 to mimic a very costly operation and ran the test again, I got the following result:
--- FAIL: TestX (0.00s)
FAIL
2022/07/24 14:31:32 Failed to wait: exit status 1
The above result doesn't contain execution time of this test package (FAIL github.com/haunt98/go-test-color 0.333s). Thus, goroutine leak is happening with your code.
The text was updated successfully, but these errors were encountered:
I added a test file
main_test.go
with the following content:Then I ran this test file and got the following output (which is fine):
When I added a
time.Sleep(2*time.Second)
at line 64 to mimic a very costly operation and ran the test again, I got the following result:The above result doesn't contain execution time of this test package (
FAIL github.com/haunt98/go-test-color 0.333s
). Thus, goroutine leak is happening with your code.The text was updated successfully, but these errors were encountered: