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

warp: test failure: Run, chunked bodies, in chunks #751

Closed
robx opened this issue Jun 4, 2019 · 9 comments
Closed

warp: test failure: Run, chunked bodies, in chunks #751

robx opened this issue Jun 4, 2019 · 9 comments

Comments

@robx
Copy link
Contributor

robx commented Jun 4, 2019

I caught a test failure building warp 3.2.23 on guix:

Failures:

  test/RunSpec.hs:300:17: 
  1) Run, chunked bodies, in chunks
       expected: ["Hello World\nBye","Hello World"]
        but got: []

  To rerun use: --match "/Run/chunked bodies/in chunks/"

Randomized with seed 596329956

Is this maybe the same problem as referenced in the comment above?

-- For some reason, the following test on Windows causes the socket

For the moment, this isn't reproducible, but I wanted to note it before it gets lost.

@robx
Copy link
Contributor Author

robx commented Jun 4, 2019

By spinning that test, I get it to fail quite reliably, within a ~100 iterations / a couple of seconds.

Raising the threadDlay by a factor 10 it happens less frequently, but it still fails now and then (after 37s this time).

With threadDelay a 10th of the original, it fails directly.

@snoyberg
Copy link
Member

snoyberg commented Jun 5, 2019

Please test against the latest version on master, which enables -threaded in the test suite. See f612eb3

@robx
Copy link
Contributor Author

robx commented Jun 5, 2019

I haven't managed to set up a master build on the guix vm yet, but applying the -threaded change by itself doesn't fix the issue.

(Do you know a way to verify that the test executable I built is compiled with -threaded? The build environment is a bit tricky to work with.)

@robx
Copy link
Contributor Author

robx commented Jun 5, 2019

It does behave a bit differently now: Most of the time it fails after precisely 4 iterations, and with half the expected result instead of an empty result.

$ ./dist/build/spec/spec -m /Run/chunked\ bodies/in\ chunks/ 

Run
  chunked bodies
    in chunks FAILED [1]

Failures:

  test/RunSpec.hs:300:17: 
  1) Run, chunked bodies, in chunks
       expected: (4,["Hello World\nBye","Hello World"])
        but got: (4,["Hello World\nBye"])

When it doesn't fail right away, it always spins for a while, typically taking longer to fail than before the -threaded change. E.g.:

Run
  chunked bodies
    in chunks FAILED [1]

Failures:

  test/RunSpec.hs:300:17: 
  1) Run, chunked bodies, in chunks
       expected: (867,["Hello World\nBye","Hello World"])
        but got: (867,["Hello World\nBye"])

  To rerun use: --match "/Run/chunked bodies/in chunks/"

Of course, it's very much unclear these changes in behaviour aren't accidental.

@snoyberg
Copy link
Member

snoyberg commented Jun 5, 2019

You can use ./executable +RTS --info. On my system: the non-threaded runtime includes ,("RTS way", "rts_v"), and the threaded runtime includes ,("RTS way", "rts_thr").

@robx
Copy link
Contributor Author

robx commented Jun 5, 2019

Thanks; then yes, I am using the threaded runtime.

@robx
Copy link
Contributor Author

robx commented Jun 5, 2019

I've built version 3.2.27 now, and I can't get it to fail anymore, whether I pass -threaded or not. If it was fixed between 3.2.23 and 3.2.27 my apologies for the outdated report. Could also be chance of course. I'm letting it spin for a bit now.

@robx
Copy link
Contributor Author

robx commented Jun 5, 2019

It seems stable, feel free to close.

@snoyberg
Copy link
Member

snoyberg commented Jun 5, 2019

Cool, thanks for confirming.

@snoyberg snoyberg closed this as completed Jun 5, 2019
robx added a commit to robx/guix that referenced this issue Jun 5, 2019
This fixes a sporadic test failure: yesodweb/wai#751

* gnu/packages/haskell-web.scm (ghc-warp): Update to 3.2.27.
robx added a commit to robx/guix that referenced this issue Jun 5, 2019
This fixes a sporadic test failure: yesodweb/wai#751

* gnu/packages/haskell-web.scm (ghc-warp): Update to 3.2.27.
mbakke pushed a commit to guix-mirror/guix that referenced this issue Jun 6, 2019
This fixes a sporadic test failure: yesodweb/wai#751

* gnu/packages/haskell-web.scm (ghc-warp): Update to 3.2.27.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants