Skip to content

Commit

Permalink
Remove fifo from wasm.sh
Browse files Browse the repository at this point in the history
Should prevent the sporadic failures in CI.
  • Loading branch information
nhooyr committed Sep 27, 2019
1 parent 181b36e commit 9b8320e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ci/wasm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ GOOS=js GOARCH=wasm go vet ./...
go install golang.org/x/lint/golint
GOOS=js GOARCH=wasm golint -set_exit_status ./...

wsjstestOut="$(mktemp -d)/stdout"
mkfifo "$wsjstestOut"
wsjstestOut="$(mktemp)"
go install ./internal/wsjstest
timeout 30s wsjstest > "$wsjstestOut" &
timeout 30s wsjstest >> "$wsjstestOut" &
wsjstestPID=$!

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

if ! wait "$wsjstestPID"; then
echo "wsjstest exited unsuccessfully"
echo "--- wsjstest exited unsuccessfully"
echo "output:"
cat "$wsjstestOut"
exit 1
Expand Down
1 change: 1 addition & 0 deletions internal/wsjstest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func main() {

os.Exit(0)
}))

wsURL := strings.Replace(s.URL, "http", "ws", 1)
fmt.Printf("%v\n", wsURL)

Expand Down

0 comments on commit 9b8320e

Please sign in to comment.