Skip to content

Commit

Permalink
Cciutea/fix process termination (#119)
Browse files Browse the repository at this point in the history
* fixed subprocess termination issue

* cleanup

* fixed broken imports

* fix flacky test
  • Loading branch information
cristianciutea authored May 24, 2022
1 parent f37c55c commit 95055ad
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions gojmx/gojmx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -865,16 +865,14 @@ func TestProcessExits(t *testing.T) {

close(waitToStart)
}()


// For troubleshooting purposes.
defer func() {
stdoutBytes, err := io.ReadAll(&stdout)
assert.NoError(t, err)
assert.Empty(t, string(stdoutBytes))
stdoutBytes, _ := io.ReadAll(&stdout)
fmt.Println(stdoutBytes)

stderrBytes, err := io.ReadAll(&stderr)
assert.NoError(t, err)
// A message will appear on stderr, depending on the OS, when the process is killed.
assert.NotEmpty(t, string(stderrBytes))
stderrBytes, _ := io.ReadAll(&stderr)
fmt.Println(stderrBytes)
}()

<-waitToStart
Expand Down

0 comments on commit 95055ad

Please sign in to comment.