提交 393aa592 编写于 作者: T Thomas Stromberg

Fail fast if the context timer has run out

上级 59af2c1c
......@@ -63,6 +63,9 @@ func TestAddons(t *testing.T) {
}
for _, tc := range tests {
tc := tc
if ctx.Err() == context.DeadlineExceeded {
t.Fatalf("Unable to run more tests (deadline exceeded)")
}
t.Run(tc.name, func(t *testing.T) {
MaybeParallel(t)
tc.validator(ctx, t, profile)
......
......@@ -69,6 +69,9 @@ func validateTunnelCmd(ctx context.Context, t *testing.T, profile string) {
}
for _, tc := range tests {
tc := tc
if ctx.Err() == context.DeadlineExceeded {
t.Fatalf("Unable to run more tests (deadline exceeded)")
}
t.Run(tc.name, func(t *testing.T) {
tc.validator(ctx, t, profile)
})
......
......@@ -89,6 +89,9 @@ func TestFunctional(t *testing.T) {
}
for _, tc := range tests {
tc := tc
if ctx.Err() == context.DeadlineExceeded {
t.Fatalf("Unable to run more tests (deadline exceeded)")
}
t.Run(tc.name, func(t *testing.T) {
tc.validator(ctx, t, profile)
})
......@@ -126,6 +129,10 @@ func TestFunctional(t *testing.T) {
}
for _, tc := range tests {
tc := tc
if ctx.Err() == context.DeadlineExceeded {
t.Fatalf("Unable to run more tests (deadline exceeded)")
}
t.Run(tc.name, func(t *testing.T) {
MaybeParallel(t)
tc.validator(ctx, t, profile)
......@@ -1072,6 +1079,11 @@ users:
for _, tc := range tests {
tc := tc
if ctx.Err() == context.DeadlineExceeded {
t.Fatalf("Unable to run more tests (deadline exceeded)")
}
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
c := exec.CommandContext(ctx, Target(), "-p", profile, "update-context", "--alsologtostderr", "-v=2")
......
......@@ -52,6 +52,9 @@ func TestMultiNode(t *testing.T) {
}
for _, tc := range tests {
tc := tc
if ctx.Err() == context.DeadlineExceeded {
t.Fatalf("Unable to run more tests (deadline exceeded)")
}
t.Run(tc.name, func(t *testing.T) {
defer PostMortemLogs(t, profile)
tc.validator(ctx, t, profile)
......
......@@ -50,6 +50,11 @@ func TestPause(t *testing.T) {
}
for _, tc := range tests {
tc := tc
if ctx.Err() == context.DeadlineExceeded {
t.Fatalf("Unable to run more tests (deadline exceeded)")
}
t.Run(tc.name, func(t *testing.T) {
tc.validator(ctx, t, profile)
if t.Failed() && *postMortemLogs {
......
......@@ -78,6 +78,7 @@ func TestStartStop(t *testing.T) {
for _, tc := range tests {
tc := tc
t.Run(tc.name, func(t *testing.T) {
MaybeParallel(t)
profile := UniqueProfileName(tc.name)
......@@ -116,6 +117,10 @@ func TestStartStop(t *testing.T) {
tcName := tc.name
tcVersion := tc.version
stc := stc
if ctx.Err() == context.DeadlineExceeded {
t.Fatalf("Unable to run more tests (deadline exceeded)")
}
t.Run(stc.name, func(t *testing.T) {
stc.validator(ctx, t, profile, tcName, tcVersion, startArgs)
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册