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

Test that blocking on stdout works as expected #52

Merged
merged 4 commits into from
Sep 27, 2023
Merged

Conversation

erikcorry
Copy link
Member

No description provided.

Copy link
Member

@floitsch floitsch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Comment on lines 13 to 21
task::
// Repeat enough that this pipe will block until the parent reads
// from stdout.
1000.repeat:
out.write "In the beginning the Universe was created.\n"
out.write "This has made a lot of people very angry and been widely regarded as a bad move.\n"
stderr.write "Done with stdout."
// Enough time for the other task to block.
sleep --ms=1000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this would make the test faster?

Suggested change
task::
// Repeat enough that this pipe will block until the parent reads
// from stdout.
1000.repeat:
out.write "In the beginning the Universe was created.\n"
out.write "This has made a lot of people very angry and been widely regarded as a bad move.\n"
stderr.write "Done with stdout."
// Enough time for the other task to block.
sleep --ms=1000
counter := 0
task::
// Repeat enough that this pipe will block until the parent reads
// from stdout.
1000.repeat:
out.write "In the beginning the Universe was created.\n"
out.write "This has made a lot of people very angry and been widely regarded as a bad move.\n"
counter++
stderr.write "Done with stdout."
// Wait for the other task to block.
last-seen := -1
while last-seen != counter:
last-seen = counter
sleep --ms=50

@erikcorry erikcorry merged commit 60f9eb6 into main Sep 27, 2023
1 of 3 checks passed
@erikcorry erikcorry deleted the test-block-stdout branch September 27, 2023 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants