Skip to content

Commit

Permalink
force exit from query slo
Browse files Browse the repository at this point in the history
  • Loading branch information
asmyasnikov committed Mar 29, 2024
1 parent b0d8770 commit 154f7e2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/slo/native/query/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"context"
"fmt"
"os"
"os/signal"
"sync"
"syscall"
Expand Down Expand Up @@ -33,6 +34,12 @@ func main() {
fmt.Println("program started")
defer fmt.Println("program finished")

go func() {
time.Sleep(time.Duration(cfg.Time+2) * time.Second)
fmt.Println("force exit")
os.Exit(1)
}()

ctx, cancel = context.WithTimeout(ctx, time.Duration(cfg.Time)*time.Second)
defer cancel()

Expand Down

0 comments on commit 154f7e2

Please sign in to comment.