forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wasi: Test the stdio streams implementation (bytecodealliance#6764)
* Add a helper for writing stdin tests * Test a use of preview2::stdio::Stdin on unix * Abstract the stdin test, and apply it to tokio::stdin and worker_thread_stdin * re-implement worker thread stdin with a watch * poll_oneoff_stdio should work on windows now * comments * test: show that restarting * reap tasks from AsyncReadStream and AsyncWriteStream when dropped the tasks will exit on their own if the receiver drops, but this should terminate them while they are awaiting on read/write. * rewrite most of the asyncfd based stdin this has still got at least one serious bug, noted with FIXME. also has a bunch of changes which can be backed out because they were chasing red herrings. the major bug was that, for some inexplicable reason, i didn't actually set the fd to nonblocking just prior to asyncfd creation. switching from the fdflags.difference to fdflags.union operator fixed that bug. * Refactor to avoid `as_mut` and `.0 .0` * Rework the stdin implementation to hold the stream in a mutex * Detect when the task backing stdin has exited * Have the thread managing stdin exit when it encounters EOF * Refactor the test to restart the runtime as well * Format prtest:full * internal tokio runtime used for sync interfaces is now new_current_thread * Remove println from test for stdout * Remove unneeded `vec!` --------- Co-authored-by: Pat Hickey <[email protected]>
- Loading branch information
1 parent
5e50976
commit 01b3363
Showing
9 changed files
with
375 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.