Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: use [tail] instead of [wait] to block on a process finishing #8303

Closed
wants to merge 1 commit into from

Conversation

pmwhite
Copy link
Collaborator

@pmwhite pmwhite commented Jul 30, 2023

I'm not entirely sure why, but when I run dune runtest on the repository, I get the following error:

./helpers.sh: line 25: wait: pid 123456 is not a child of this shell

My hypothesis is that the command that starts dune is run from within a different sub-shell than the command that stops it. What confuses me is that this error doesn't show up in CI jobs; maybe it's because of differences in the version of bash on my machine and the CI machine? In any case, I think using tail is more robust to changes in the structure of the scripts, so even if I could fix my environment to make the tests pass, I think this is a good change.

Signed-off-by: Philip White code@trailingwhite.space

@pmwhite pmwhite changed the title tests: use [tail`]instead of [wait] to block on a process finishing tests: use [tail]instead of [wait] to block on a process finishing Jul 30, 2023
@pmwhite pmwhite changed the title tests: use [tail]instead of [wait] to block on a process finishing tests: use [tail] instead of [wait] to block on a process finishing Jul 30, 2023
@pmwhite pmwhite force-pushed the use-tail-instead-of-wait branch from a5efde7 to 2887a32 Compare July 30, 2023 17:21
@Alizter
Copy link
Collaborator

Alizter commented Jul 30, 2023

Hi, see my PR solving the same issue: #8201

The reason is due to a bug in bash which aliases the pid causing wait to lose track of its children.

I'm not entirely sure why, but when I run [dune runtest] on the repository, I
get the following error:

  ./helpers.sh: line 25: wait: pid 123456 is not a child of this shell

My hypothesis is that the command that starts dune is run from within a
different sub-shell than the command that stops it. What confuses me is that
this error doesn't show up in CI jobs; maybe it's because of differences in the
version of bash on my machine and the CI machine? In any case, I think using
[tail] is more robust to changes in the structure of the scripts, so even if I
could fix my environment to make the tests pass, I think this is a good change.

Signed-off-by: Philip White <code@trailingwhite.space>
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.

2 participants