Skip to content

Commit

Permalink
fs: kill subprocess before tearing down test
Browse files Browse the repository at this point in the history
Change-Id: Ie0208ec43f50910201b8ff97f639ad55fbd319a3
  • Loading branch information
hanwen committed Jun 12, 2023
1 parent d213835 commit 255ab74
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions fs/simple_test.go
Expand Up @@ -585,12 +585,19 @@ func TestFsstress(t *testing.T) {
if err != nil {
t.Fatal(err)
}
wg.Add(1)
go func() {
cmd.Wait()
wg.Done()
}()

defer cmd.Process.Kill()

// Run the test for 1 second. If it deadlocks, it usually does within 20ms.
time.Sleep(1 * time.Second)

cancel()
cmd.Process.Kill()

// waitTimeout waits for the waitgroup for the specified max timeout.
// Returns true if waiting timed out.
Expand Down

0 comments on commit 255ab74

Please sign in to comment.