Skip to content

Commit

Permalink
refactor: switch syscall to os for cross platform use
Browse files Browse the repository at this point in the history
  • Loading branch information
fwilkerson committed Nov 27, 2024
1 parent 928c8b9 commit fd7b757
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions humacli/humacli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"log"
"net/http"
"os"
"syscall"
"testing"
"time"

Expand Down Expand Up @@ -213,9 +212,14 @@ func TestCLIShutdown(t *testing.T) {
})
})

p, err := os.FindProcess(os.Getpid())
if err != nil {
t.Fatalf("failed to find process: %v", os.Getpid())
}

go func() {
time.Sleep(10 * time.Millisecond)
syscall.Kill(syscall.Getpid(), syscall.SIGINT)
p.Kill()
}()

cli.Root().SetArgs([]string{})
Expand Down

0 comments on commit fd7b757

Please sign in to comment.