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
When enable parallel testing, we would expect the TearDownSuite() to be called after all the tests completed. However, after this commit, 3104bf5
the parallel testing is broken as the TearDownSuite() is called before tests are done.
Here is a simple repro code to repro:
type MyTestSuite struct {
suite.Suite
}
func TestMySuite(t *testing.T) {
suite.Run(t, new(MyTestSuite))
}
func (s *MyTestSuite) SetupSuite() {
fmt.Println("SetupSuite")
}
func (s *MyTestSuite) TearDownSuite() {
fmt.Println("TearDownSuite")
}
func (s *MyTestSuite) SetupTest() {
s.T().Parallel()
fmt.Println("SetupTest")
}
func (s *MyTestSuite) TearDownTest() {
fmt.Println("TearDownTest")
}
func (s *MyTestSuite) Test_A() {
time.Sleep(time.Second)
}
func (s *MyTestSuite) Test_B() {
time.Sleep(time.Second * 2)
}
When enable parallel testing, we would expect the TearDownSuite() to be called after all the tests completed. However, after this commit, 3104bf5
the parallel testing is broken as the TearDownSuite() is called before tests are done.
Here is a simple repro code to repro:
The output of above tests is:
The text was updated successfully, but these errors were encountered: