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
Restore testing with stack / nix-shell #195
Conversation
Current test scores:
but occur on different tests every time.
Note that these failures are on Linux. Mac results forthcoming. |
Mac failure, using
There were 19 failures in total, these 3 are just a sample. |
With concurrency activated, the tests mostly don't time out anymore. However, we do see quite a lot of:
That log message appears throughout, even when the tests all succeed. When the stars align, enough blocks occur and the tests hang. |
The |
|
Removing |
@fosskers Hmmm, any chance you can dig into the code to see what's the source of the non-determinism? |
That's the plan. |
Among many others, the following REPL tests fail with
This is very telling. It's essentially:
|
My lord.
|
I'm going to revisit this tomorrow. |
bf2dc24
to
f9424dc
Compare
@emilypi and I discovered that forcing |
Pinging @slpopejoy @mightybyte to solicit feedback. As reported in the comment above, the The way @emilypi and I see it, we could:
The Question for @slpopejoy : do we have a hard-requirement on the |
@fosskers We just discussed this with @slpopejoy. The official word is that we have a hard requirement to call out to a low-level C library. The |
Ok cool. Relative to Dropping
|
For now I'm going to alter this PR to address only the issues surrounding the concurrency flags used in the test suites. A subsequent PR will be called something like "Explore Cryptonite" with the specific purpose of replacing |
Sounds good @fosskers 😄 |
f9424dc
to
6132145
Compare
Rebased. |
" could not be cancelled.") | ||
_ -> return () | ||
|
||
stopServer (asyncServer, _, _) = cancel asyncServer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If @slpopejoy signs off on this, looks like it's good to go.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@LindaOrtega made this suggestion originally. This change prevents a few sporadic connection failures in the tests.
6132145
to
25f3aa9
Compare
Rebased onto |
- Also avoid server cancelling in tests, or else certain requests sporadically fail.
25f3aa9
to
cda3554
Compare
Rebased to fix merge conflicts. |
Some observations:
Currently I'm trying to cut down the |
I have good news and bad news. Good news: This issue is now easily reproducible in a $ git clone https://github.com/kadena-io/pact
$ cd pact
$ cat > tests/HashSpec.hs << EOF
{-# LANGUAGE OverloadedStrings #-}
module HashSpec (spec) where
import Test.Hspec
import Pact.Types.Hash (hash)
spec :: Spec
spec = do
describe "hashing" $ do
it "hashes the empty string correctly" $ do
let foo = hash ""
let bar = hash ""
foo `shouldBe` bar
it "hashes \"hello\" correctly" $ do
let foo = hash "hello"
let bar = hash "hello"
foo `shouldBe` bar
EOF
$ nix-shell -A shells.ghc
[nix-shell]$ runhaskell Setup.hs configure --enable-tests
<...>
[nix-shell]$ runhaskell Setup.hs build
<...>
[nix-shell]$ runhaskell Setup.hs test Bad news: I tried reproducing the failure with Stack but all tests pass, even with this change. |
@vaibhavsagar your hspec tests there do indeed fail in
That's fascinating. |
@fosskers after making the change to |
Two more interesting observations:
$ git clone --recursive -b minimal-failure-repro https://github.com/vaibhavsagar/pact.git
$ cd pact
$ git checkout 1d2320d
$ nix-shell -p 'haskellPackages.ghcWithPackages (p: [ p.cabal-install ])'
$ LIBRARY_PATH=$(nix-build --no-out-link -E '(import <nixpkgs> {}).zlib')/lib:$LIBRARY_PATH C_INCLUDE_PATH=$(nix-build --no-out-link -E '(import <nixpkgs> {}).zlib.dev')/include:$C_INCLUDE_PATH cabal new-test The Nix commands are only used because I was running this on NixOS, but I imagine it would work the same on another Linux distro.
We suspected that the inclusion of Edit: I tried adding all these dependencies except |
@vaibhavsagar re: your |
No, this failure can be reproduced with Stack as well: haskell/cabal#5583 (comment). I think it's interesting that |
Closing. These changes were superseded by other changes and the build is working now. |
TODO
stack
/nix-shell
test failures (related)Debugnix-build
test failuresMotivation
To further the move to Nix, this PR restores the ability to build and test with the various Nix tools.