-
Notifications
You must be signed in to change notification settings - Fork 696
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
cabal test
freezes but cabal test --show-details=streaming
works
#1810
Comments
@ttuegel do you mind taking a look? |
@jstolarek Which operating system are you testing on? |
This is 64-bit Linux |
@jstolarek Could you |
Sure. Log is about 1.5MB - where should I upload it? |
Could you just paste the last 10 lines? On Thu, Apr 24, 2014 at 11:41 AM, Jan Stolarek [email protected]:
|
Sure. Last 2K lines or so look identical:
This is interrupted several times with
And before all that start there's:
Hope that helps. |
I'm experiencing the same issue here with Cabal 1.20. Here is a failed Travis CI build. Here is a source tree, which reproduces the issue. |
@ttuegel have you been able to reproduce the issue or do you need help with that? |
@tibbe I have reproduced @jstolarek's problem, but I haven't checked if it's the same as @nikita-volkov's. The freeze happens because |
So if this didn't happen in 1.18, where we didn't have streaming, then we must either be invoking the process in the same way, not waiting for it to finish in the same way, or not passing it handles that in the same state. Some printf style debugging might tell us. |
This issue is present running the vty test suite under cabal 1.20. Using cabal 1.18 the issue is not present. Using "--show-details=streaming" does not appear to make a difference. I attached gdb to the "stuck" process and acquired this backtrace:
Which is interesting: There is only a single thread and the thread appears to be just waiting on an event that never occurs. Not all vty tests freeze. Out of ~14 test suites 4 freeze. These are a subset of those that use quickcheck. If the use of quickcheck is removed then the tests do not freeze. I have started putting together a minimal repro case from the vty test suite. For the impatient:
I'll be pulling this code into a separate project when I get a chance. |
I wonder if this is I/O manager related. |
Here is a (almost) minimal project which reproduces the issue: https://github.com/coreyoconnor/cabal-issue-1810
I am using 64bit linux and ghc 7.8.2. |
Just ran into this. I think the problem is with how cabal install is saving output (stdout and stderr) from tests. When streaming is disabled, 'tee' dumps the process output into a pipe, but that pipe isn't read until after the process finishes. This means the pipe fills up and then the process just goes to sleep, waiting for the pipe to drain. If you enable streaming, one of the branches in tee can keep reading from the pipe because it is always mirroring output to stdout. |
@travitch I suspect you're right. We can always stream the log handle--the one that is saved now--to a temporary file and read it back when needed (that's what the log code did before, anyway). |
Actually, |
I take back my last comment. Of course |
@coreyoconnor I just noticed that your example uses @jstolarek Are you also using |
@ttuegel No, I'm only using What's interesting is that this bug keeps disappearing and reappearing. For example with the latest commit of |
@ttuegel Interesting! I was unaware that QuickCheck was not supported under detailed-0.9. vty has been using detailed + QuickCheck for quite some time without issue. I won't mind switching to exitcode-stdio via test-framework if detailed+QuickCheck is really never supposed to work. |
@coreyoconnor To support |
@jstolarek Does it ever fail if all the tests pass? I have only been able to reproduce with test suites with at least one failing test. |
@ttuegel I don't know, I haven't paid attention to this. At the moment I can only verify that it can work correctly with some tests failing. |
Issue haskell#1810. Some test suites would freeze if invoked with `--show-details=always` instead of `--show-details=streaming` because output would build up in the pipe without being cleared. This corrects the issue by forcing the length of the output string in another thread.
@snoyberg Could you check |
If that's the case, wouldn't it be better to have a lower bound on the |
Actually, doing a sanity check right now... Cabal-1.20.0.2 isn't even available on Hackage. |
@tibbe Can there be a Cabal-1.20.0.2 release to correspond to the recent cabal-install release? The fix for this bug was included in the 1.20 branch, but all the test runner code is in Cabal. |
I would also recommend including a cabal-install-1.20.0.3 release that includes a lower bound on Cabal to ensure the bug fix gets included. |
In case it's useful for you to know, I'm building a new |
I've put out a Cabal-1.20.0.1 with the missing patch. Sorry for the mess-up. I'll send out request for binaries so we can upload cabal-install binaries built against Cabal-1.20.0.1 and cabal-install-1.20.0.2. |
Thanks @tibbe. Does this in any way affect the backported patches for cabal-install 1.18? If so, that should probably be brought up for the HP release. |
1.18 is unaffected as this is a bug fix for a problem introduced in 1.20 when streaming test output was added. |
Please run using "cabal test --show-details=streaming", there's a known issue about this that was fixed in the latest version of cabal: haskell/cabal#1810
I have a feeling something is still broken here. I kicked off a Stackage build on Friday, and on Sunday morning, the test suite is stalled running the following four tests:
I'll try to provide more information, but I can tell you that removing --show-details=streaming caused Stackage to stall once again. |
This reverts commit 189bb1d.
I cannot reproduce the test suite stalling in those four packages. The test suites finish for me with or without |
I can only reproduce this behavior when run from within Stackage, so it may be some kind of locking going on instead, I can't be certain. In any event, The system I'm running this on in an Amazon EC2 small, running Ubuntu 14.04 64-bit. |
Sorry guys, but this ticket needs to be re-opened. Testsuite for I'm using GHC 7.8.3, Cabal 1.20.0.0, cabal-install 1.20.0.3 and latest |
Is |
Steps to reproduce:
Note that we are currently suffering from a serious memory leak so compiling |
You said you are using Cabal-1.20.0.0; the fix for this problem was in one of the point releases. I cannot reproduce with cabal-install-1.20.0.3 and Cabal-1.20.0.2. |
@ttuegel you're right, upgrading to Cabal-1.20.0.2 solves the problem. I assumed that if I bootstrap cabal-install it installs the latest Cabal version (now I know it doesn't). |
I think it should, but it looks like the bootstrap script didn't get updated with the point releases. |
I can confirm this problem.
ghc version:
I 'm using |
Had (Have) the same problem. Switching to stack using stack (>>stack test<<) works. Though this does not solve the issue it's still a workaround.. |
I'm running the testsuite for singletons package. When I run
cabal test
the testsuite freezes, but if I add--show-details=streaming
it works perfectly and finishes after ~30seconds. This happens with cabal 1.20 and GHC 7.8.2.The text was updated successfully, but these errors were encountered: