Skip to content

Conversation

benhoyt
Copy link
Owner

@benhoyt benhoyt commented May 24, 2022

This is a manifestation of golang/go#21922 - use pipes to fix it. Tricky!

Fixes #122.

benhoyt added 5 commits May 22, 2022 21:10
This is an issue with the (grand)child process holding stdout/stderr,
so per golang/go#21922 (comment)
use a pipe to work around this.
Still has some kind of race condition ... not sure why:

$ go test ./interp -awk='' -run='Interp/system.*echo_foo' -count=1000
--- FAIL: TestInterp (0.01s)
    --- FAIL: TestInterp/BEGIN_{_print_system("echo_foo");_print_system("echo_bar")_}__#_!fuzz (0.00s)
        interp_test.go:879: expected "foo\n0\nbar\n0\n", got "0\nbar\n0\n"
--- FAIL: TestInterp (0.01s)
    --- FAIL: TestInterp/BEGIN_{_print_system("echo_foo");_print_system("echo_bar")_}__#_!fuzz (0.00s)
        interp_test.go:879: expected "foo\n0\nbar\n0\n", got "0\nbar\n0\n"
FAIL
FAIL	github.com/benhoyt/goawk/interp	5.241s
FAIL
@benhoyt benhoyt marked this pull request as draft March 25, 2024 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cancelling ctx in system() doesn't actually stop it

1 participant