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

haskellPackages.grammatical-parsers: unmark broken #71383

Merged
merged 1 commit into from Oct 24, 2019

Conversation

endgame
Copy link
Contributor

@endgame endgame commented Oct 19, 2019

Motivation for this change

haskellPackages.grammatical-parsers builds with config.allowBroken = true.
Fixes #68468

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @peti

@endgame
Copy link
Contributor Author

endgame commented Oct 19, 2019

Not sure why this has picked up two commits; a cherry-pick may be warranted. Note also the commit message on my commit: there's a nondeterministic test failure that I haven't been able to replicate.

How would you like to proceed?

@cdepillabout
Copy link
Member

cdepillabout commented Oct 19, 2019

@endgame Can you change the merge base into the haskell-updates branch, instead of master? Also, you might want to go ahead and just rebase your commit on top of haskell-updates. That should make it a little easier for peti.

If you haven't seen it, you might want to check out the video on updating Haskell packages:

https://discourse.nixos.org/t/video-tutorial-how-to-fix-broken-haskell-packages-in-nix/3968

there's a nondeterministic test failure that I haven't been able to replicate

As far as I am aware, non-deterministic test failures are generally not accepted into nixpkgs. If you're sure this isn't actually a problem, you could mark the package dontCheck. Here's an example of another package being marked like this:

# Tests are failing
# https://github.com/bos/statistics/issues/123
statistics = dontCheck super.statistics;

Please also report this test failure upstream and leave a link to it in a comment in the above file. This will help the nixpkgs maintainers know when dontCheck can be removed.

(I tried compiling this and I ran into the test failing.)

Also, one last thing, as long as you'll be rebasing your changes on top of haskell-updates, you may want to change the commit message (and PR title) to be something like haskellPackages.grammatical-parsers: mark unbroken. This is the recommended style in the CONTRIBUTING.md file. Although some maintainers aren't strict about this at all.

@endgame endgame changed the base branch from master to haskell-updates October 19, 2019 23:36
@endgame endgame changed the title Grampa unbroken haskellPackages.grammatical-parsers: unmark broken Oct 19, 2019
I did see a timeout in the test suite, in the mconcat property test
provided by checkers, but lost the seed.
@endgame
Copy link
Contributor Author

endgame commented Oct 19, 2019

Fixed most of your comments. The test failure is a timeout: I suspect on the one particular run, checkers generated a giant test which caused the failure. Are time limits on test suites imposed by nixpkgs or by cabal?

@cdepillabout
Copy link
Member

cdepillabout commented Oct 20, 2019

@endgame Thanks for updating this PR.

When running the tests on my machine, the test failure looks like the following:

Running 2 test suites...
Test suite quicktests: RUNNING...
Grampa
  ...
  classes
    monoid
      left  identity:     OK
        +++ OK, passed 100 tests.
      right identity:     OK
        +++ OK, passed 100 tests.
      associativity:      OK (0.21s)
        +++ OK, passed 100 tests.
      mappend = (<>):     OK (0.16s)
        +++ OK, passed 100 tests.
      mconcat:            FAIL (2.14s)
        *** Failed! Timeout (after 95 tests):
        Use --quickcheck-replay=83506 to reproduce.
    functor
      identity:           OK
        +++ OK, passed 100 tests.
      compose:            OK
        +++ OK, passed 100 tests.
    applicative
      identity:           OK
        +++ OK, passed 100 tests.
      composition:        OK (0.02s)
        +++ OK, passed 100 tests.
      homomorphism:       OK
        +++ OK, passed 100 tests.
      interchange:        OK
        +++ OK, passed 100 tests.
      functor:            OK
        +++ OK, passed 100 tests.
    Alternative laws
      left identity:      OK
        +++ OK, passed 100 tests.
      right identity:     OK
        +++ OK, passed 100 tests.
      associativity:      OK (0.02s)
        +++ OK, passed 100 tests.
    monad laws
      left  identity:     OK
        +++ OK, passed 100 tests.
      right identity:     OK
        +++ OK, passed 100 tests.
      associativity:      OK
        +++ OK, passed 100 tests.
      pure:               OK
        +++ OK, passed 100 tests.
      ap:                 OK
        +++ OK, passed 100 tests.
    monad functor
      bind return:        OK
        +++ OK, passed 100 tests.
    monad applicative
      pure:               OK
        +++ OK, passed 100 tests.
      ap:                 OK
        +++ OK, passed 100 tests.
    MonadPlus laws
      left zero:          OK
        +++ OK, passed 100 tests.
      left identity:      OK
        +++ OK, passed 100 tests.
      right identity:     OK
        +++ OK, passed 100 tests.
      associativity:      OK (0.01s)
        +++ OK, passed 100 tests.
      left distribution:  OK (0.01s)
        +++ OK, passed 100 tests.
  ...

1 out of 56 tests failed (3.50s)
Test suite quicktests: FAIL
Test suite logged to: dist/test/grammatical-parsers-0.4.1.1-quicktests.log
Test suite doctests: RUNNING...
Test suite doctests: PASS
Test suite logged to: dist/test/grammatical-parsers-0.4.1.1-doctests.log
1 of 2 test suites (1 of 2 test cases) passed.
builder for '/nix/store/1z673v0mjl39hcrp1nnz3a1p3n4g70hj-grammatical-parsers-0.4.1.1.drv' failed with exit code 1
error: build of '/nix/store/1z673v0mjl39hcrp1nnz3a1p3n4g70hj-grammatical-parsers-0.4.1.1.drv' failed

Here's the line in question:

      mconcat:            FAIL (2.14s)
        *** Failed! Timeout (after 95 tests):
        Use --quickcheck-replay=83506 to reproduce.

It does appear to be a timeout, as you suggest. My guess is that this is a timeout from QuickCheck. You might want to try running this test with stack test or cabal new-test and seeing if the error still occurs sometimes.

If the error does still occur, please report it upstream so the author knows to bump the timeout (or scale down the size of generated test cases).

If the error doesn't still occur, then it is likely some sort of nix-related problem. The easiest solution is probably just to disable the tests with dontCheck, as explained above.

@endgame
Copy link
Contributor Author

endgame commented Oct 20, 2019

Confirmed timeouts outside of nixpkgs, reported upstream.

@peti
Copy link
Member

peti commented Oct 20, 2019

QuickCheck supports timeouts for its tests: http://hackage.haskell.org/package/QuickCheck-2.13.2/docs/Test-QuickCheck.html#v:within. I guess these are necessary for properties that rely on suchThat et al where QuickCheck doesn't know how to construct a valid test input. Instead, the library constructs random test inputs and checks whether they satisfy a given predicate. I guess that might take a long time if "valid" inputs are sufficiently rare and sufficiently expensive to construct.

At the same time, it's feels silly to hard-code magic timeout values into your test suite, because what constitutes a reasonable timeout depends entirely on the environment that runs the tests, so how is the developer supposed to know that? If anything, that should be a command-line argument to the test suite.

@endgame
Copy link
Contributor Author

endgame commented Oct 20, 2019

grammatical-parsers-0.4.1.2 just got pushed to hackage, with a max test size and raised time limit. I'm only here because I'm N levels into a yakshave and I don't think many people are using the package, so let's wait for the package set updates to pull grammatical-parsers-0.4.1.2, then merge this. That way we don't have to do the dontCheck/remove dontCheck dance.

@peti peti merged this pull request into NixOS:haskell-updates Oct 24, 2019
@endgame endgame deleted the grampa-unbroken branch October 24, 2019 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants