Skip to content

Instantly share code, notes, and snippets.

@unconsolable
Created September 12, 2021 14:35
Show Gist options
  • Save unconsolable/2c94e5bd5dac14e963c356b14d279846 to your computer and use it in GitHub Desktop.
Save unconsolable/2c94e5bd5dac14e963c356b14d279846 to your computer and use it in GitHub Desktop.
timeout sample
package sample1_test
import (
"testing"
"time"
. "github.com/pingcap/check"
)
func TestParallel1(t *testing.T) {
t.Parallel()
if 1 == 2 {
t.Fatalf("1")
}
}
func TestParallel2(t *testing.T) {
t.Parallel()
if 1 == 2 {
t.Fatalf("2")
}
}
func TestSerial(t *testing.T) {
CustomVerboseFlag = true
*CustomParallelSuiteFlag = true
TestingT(t)
}
type Suite1 struct{}
var _ = SerialSuites(&Suite1{})
func (s *Suite1) SetUpSuite(c *C) {
}
func (s *Suite1) TearDownSuite(c *C) {
}
func (s *Suite1) TestX(c *C) {
time.Sleep(time.Minute)
}
func TestParallel3(t *testing.T) {
t.Parallel()
if 1 == 2 {
t.Fatalf("3")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment