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
x/playground: ExampleNoOutput test is flaky #24615
Comments
I am unable to reproduce this. How do you run those tests? When I run
Does it happen for the commit 76d1738? |
That particular test is the only one expecting output of two different kinds in Events slice: Trying to write to stderr and stdout gives inconsistent output when writing both to
https://play.golang.org/p/8du1N7eAxmq gives
https://play.golang.org/p/yky_PWrcZvu gives
This program produces correct order in my local playground. |
And then I got to this function: https://github.com/golang/go/blob/master/src/runtime/sys_nacl_amd64p32.s#L63
ping @minux |
The problem is not about patched
Since we have two parallel writers, for stderr and stdout, Another crude temporary fix would be to patch sandbox code to capture both kind of output into the same writer
Since stdout and stderr output looks exactly the same on playground UI, then we could apply this patch until we find a proper fix. |
Of course we can resort to just fixing the test and closing the issue. Then spawn another issue for fixing stdout/stderr messed up order. @andybons, what do you think? |
Change https://golang.org/cl/104857 mentions this issue: |
Change https://golang.org/cl/105235 mentions this issue: |
Change https://golang.org/cl/105496 mentions this issue: |
Change https://golang.org/cl/106216 mentions this issue: |
The process reading the output of the binary may read stderr and stdout separately, and may interleave reads from the two streams arbitrarily. Because we explicitly serialize writes on the writer side, we can reuse a timestamp within a single stream without losing information; however, if we use the same timestamp for write on both streams, the reader can't tell how to interleave them. This change ensures that every time we change between the two fds, we also bump the timestamp. That way, writes within a stream continue to show the same timestamp, but a sorted merge of the contents of the two streams always interleaves them in the correct order. This still requires a corresponding change to the Playground parser to actually reconstruct the correct interleaving. It currently merges the two streams without reordering them; it should instead buffer them separately and perform a sorted merge. (See https://golang.org/cl/105496.) Updates #24615. Updates #24659. Change-Id: Id789dfcc02eb4247906c9ddad38dac50cf829979 Reviewed-on: https://go-review.googlesource.com/105235 Run-TryBot: Bryan C. Mills <bcmills@google.com> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Yury Smolsky <yury@smolsky.by> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Change https://golang.org/cl/106475 mentions this issue: |
Add a test case (currently flaky) that checks for deterministic output ordering. Updates golang/go#24615. Updates golang/go#24659. Change-Id: I7edc5d77a890edcd684ddf2aeee4c7a7dea68af1 Reviewed-on: https://go-review.googlesource.com/106216 Reviewed-by: Andrew Bonventre <andybons@golang.org>
Add a test case that checks fake timestamps generated by the patched runtime.write. Updates golang/go#24615 Updates golang/go#24659 Change-Id: I210cfd4500e7f72567539dd9b3e23da4f907a3e2 Reviewed-on: https://go-review.googlesource.com/106475 Reviewed-by: Bryan C. Mills <bcmills@google.com>
When running the playgrounds within the
Dockerfile
, it sometimes fails withafter updating the test code, it will sometimes fail with:
The output seems non-deterministic, which is odd.
@ysmolsky
The text was updated successfully, but these errors were encountered: