Skip to content

Commit 8d373d8

Browse files
committed
force exit from query slo
1 parent 8f8da10 commit 8d373d8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/slo/native/query/main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package main
33
import (
44
"context"
55
"fmt"
6+
"os"
67
"os/signal"
78
"sync"
89
"syscall"
@@ -33,6 +34,12 @@ func main() {
3334
fmt.Println("program started")
3435
defer fmt.Println("program finished")
3536

37+
go func() {
38+
time.Sleep(time.Duration(cfg.Time+2) * time.Second)
39+
fmt.Println("force exit")
40+
os.Exit(1)
41+
}()
42+
3643
ctx, cancel = context.WithTimeout(ctx, time.Duration(cfg.Time)*time.Second)
3744
defer cancel()
3845

0 commit comments

Comments
 (0)