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

Race condition in stdout/stderr piping #3328

Closed
lihaoyi opened this issue Jul 31, 2024 · 3 comments
Closed

Race condition in stdout/stderr piping #3328

lihaoyi opened this issue Jul 31, 2024 · 3 comments
Milestone

Comments

@lihaoyi
Copy link
Member

lihaoyi commented Jul 31, 2024

mill.integration.SubprocessStdoutTests seems to fail flakily with the error below.

X mill.integration.SubprocessStdoutTests.0 8751ms 
  utest.AssertionError: res1.contains(
  res1: String = [info] compiling 1 Scala source to /home/runner/work/mill/mill/out/integration/feature/subprocess-stdout/local/workspaceDir.dest/out/mill-build/compile.dest/classes ...
  [info] done compiling
  print stdout1
  proc stdout1
  print stderr1
  print stdout2
  proc stderr1
  proc stdout2
  print stderr2
  proc stderr2
  print stdout3
  proc stdout3
  print stderr3
  proc stderr3
  print stdout4
  proc stdout4
  print stderr4
  proc stderr4
  print stdout5
  proc stdout5
  print stderr5
  proc stderr5
  print stdout6
  proc stdout6
  print stderr6
  proc stderr6
  print stdout7
  proc stdout7
  print stderr7
  proc stderr7
  print stdout8
  proc stdout8
  print stderr8
  proc stderr8
  print stdout9
  proc stdout9
  print stderr9
  proc stderr9

The first 5 lines seem to indicate the the stdout/stderr from println and os.proc is not being captured in order:

  print stdout1
  proc stdout1
  print stderr1
  print stdout2
  proc stderr1
  proc stdout2
  print stderr2
  proc stderr2

#3275 was meant to solve the issue with the stdout ordering, so something funny must be going on

@lihaoyi
Copy link
Member Author

lihaoyi commented Aug 11, 2024

Maybe fixed by #3360? Let's see if it comes back

@lihaoyi lihaoyi closed this as completed Aug 11, 2024
@lefou lefou added this to the 0.12.0 milestone Aug 11, 2024
@lihaoyi lihaoyi reopened this Aug 18, 2024
@lihaoyi
Copy link
Member Author

lihaoyi commented Aug 18, 2024

I'm still seeing this happen in master, e.g. https://github.com/com-lihaoyi/mill/actions/runs/10437082287/job/28902913813?pr=3378

X mill.integration.SubprocessStdoutTests.0 9627ms 
  utest.AssertionError: res1.contains(
  res1: String = [info] compiling 1 Scala source to /home/runner/work/mill/mill/out/integration/feature/subprocess-stdout/local/workspaceDir.dest/out/mill-build/compile.dest/classes ...
  [info] done compiling
  print stdout1
  proc stdout1
  print stderr1
  print stdout2
  proc stderr1
  proc stdout2
  print stderr2
  proc stderr2
  print stdout3
  proc stdout3
  print stderr3
  proc stderr3
  print stdout4
  proc stdout4
  print stderr4
  proc stderr4
  print stdout5
  proc stdout5
  print stderr5
  proc stderr5
  print stdout6
  proc stdout6
  print stderr6
  proc stderr6
  print stdout7
  proc stdout7
  print stderr7
  proc stderr7
  print stdout8
  proc stdout8
  print stderr8
  proc stderr8
  print stdout9
  proc stdout9
  print stderr9
  proc stderr9
    utest.asserts.Asserts$.assertImpl(Asserts.scala:30)
    mill.integration.SubprocessStdoutTests$.$anonfun$tests$3(SubprocessStdoutTests.scala:15)
    scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
    utest.asserts.Asserts.retry(Asserts.scala:96)
    utest.asserts.Asserts.retry$(Asserts.scala:95)
    utest.package$.retry(package.scala:8)
    mill.integration.SubprocessStdoutTests$.$anonfun$tests$2(SubprocessStdoutTests.scala:15)

@lefou lefou removed this from the 0.12.0 milestone Aug 18, 2024
@lihaoyi
Copy link
Member Author

lihaoyi commented Sep 26, 2024

Going to close this again since #3577 overhauls this area of the code, we can re-open if the issue persists

@lihaoyi lihaoyi closed this as completed Sep 26, 2024
@lefou lefou added this to the 0.12.0-RC3 milestone Sep 26, 2024
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

No branches or pull requests

2 participants