Skip to content

Commit baef216

Browse files
committed
Move to just a sleep
1 parent debd8d2 commit baef216

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

.github/workflows/test.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ on:
88
- "CONTRIBUTING.md"
99
workflow_dispatch:
1010

11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
1115
env:
1216
CARGO_TERM_COLOR: always
1317
WASI_SDK_VERSION: 20.46gf3a1f8991535

tests/componentize.rs

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,10 @@ fn http_example() -> anyhow::Result<()> {
7777
let mut handle = std::process::Command::new("wasmtime")
7878
.current_dir(&path)
7979
.args(["serve", "--wasi", "common", "http.wasm"])
80-
.stderr(Stdio::piped())
8180
.spawn()?;
8281

83-
let mut buf = [0; 36];
84-
let mut stderr = handle.stderr.take().unwrap();
85-
86-
// Read until "Serving HTTP" shows up on Unix
87-
// (stderr blocks on windows)
88-
#[cfg(unix)]
89-
retry(
90-
|| -> anyhow::Result<()> {
91-
if stderr.read(&mut buf)? == 0 {
92-
return Err(anyhow::anyhow!("No data"));
93-
}
94-
if !String::from_utf8(buf.to_vec())?.contains("Serving HTTP on http://0.0.0.0:8080/") {
95-
return Err(anyhow::anyhow!("Wrong output"));
96-
}
97-
Ok(())
98-
},
99-
10,
100-
)?;
82+
// Sleep a bit to give the server time to start
83+
std::thread::sleep(Duration::from_secs(3));
10184

10285
let content = "’Twas brillig, and the slithy toves
10386
Did gyre and gimble in the wabe:

0 commit comments

Comments
 (0)