Skip to content

Commit 9b8320e

Browse files
committed
Remove fifo from wasm.sh
Should prevent the sporadic failures in CI.
1 parent 181b36e commit 9b8320e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

ci/wasm.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ GOOS=js GOARCH=wasm go vet ./...
99
go install golang.org/x/lint/golint
1010
GOOS=js GOARCH=wasm golint -set_exit_status ./...
1111

12-
wsjstestOut="$(mktemp -d)/stdout"
13-
mkfifo "$wsjstestOut"
12+
wsjstestOut="$(mktemp)"
1413
go install ./internal/wsjstest
15-
timeout 30s wsjstest > "$wsjstestOut" &
14+
timeout 30s wsjstest >> "$wsjstestOut" &
1615
wsjstestPID=$!
1716

18-
WS_ECHO_SERVER_URL="$(timeout 10s head -n 1 "$wsjstestOut")" || true
17+
# See https://superuser.com/a/900134
18+
WS_ECHO_SERVER_URL="$( (tail -f -n0 "$wsjstestOut" &) | timeout 10s head -n 1)"
1919
if [[ -z $WS_ECHO_SERVER_URL ]]; then
2020
echo "./internal/wsjstest failed to start in 10s"
2121
exit 1
@@ -25,7 +25,7 @@ go install github.com/agnivade/wasmbrowsertest
2525
GOOS=js GOARCH=wasm go test -exec=wasmbrowsertest ./... -args "$WS_ECHO_SERVER_URL"
2626

2727
if ! wait "$wsjstestPID"; then
28-
echo "wsjstest exited unsuccessfully"
28+
echo "--- wsjstest exited unsuccessfully"
2929
echo "output:"
3030
cat "$wsjstestOut"
3131
exit 1

internal/wsjstest/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ func main() {
3636

3737
os.Exit(0)
3838
}))
39+
3940
wsURL := strings.Replace(s.URL, "http", "ws", 1)
4041
fmt.Printf("%v\n", wsURL)
4142

0 commit comments

Comments
 (0)