Skip to content
This repository has been archived by the owner on Oct 29, 2021. It is now read-only.

servant-auth-client test failure on macOS #113

Open
domenkozar opened this issue Jul 25, 2018 · 2 comments
Open

servant-auth-client test failure on macOS #113

domenkozar opened this issue Jul 25, 2018 · 2 comments

Comments

@domenkozar
Copy link
Collaborator

domenkozar commented Jul 25, 2018

https://nix-cache.s3.amazonaws.com/log/7liljvzs9fbj1844y4iw0agnqlbmwfcd-servant-auth-client-0.3.3.0.drv

Failures:

  test/Servant/Auth/ClientSpec.hs:68:3: 
  1) Servant.Auth.Client, The JWT combinator, HasClient, fails when token is expired
       uncaught exception: IOException of type ResourceExhausted
       /dev/urandom: openFd: resource exhausted (Too many open files)
       (after 47 tests)

  To rerun use: --match "/Servant.Auth.Client/The JWT combinator/HasClient/fails when token is expired/"

Randomized with seed 1188103930

Seems like entropy source is not closed correctly.

@domenkozar domenkozar changed the title servant-auth-client test failure on macos servant-auth-client test failure on macOS Jul 25, 2018
@domenkozar
Copy link
Collaborator Author

https://github.com/haskell-crypto/cryptonite/blob/4622e5fc8ece82f4cf31358e31cd02cf020e558e/Crypto/Random/Entropy/Unix.hs#L48 is called as part of entropyOpen so the exhaustion happened somewhere else.

@erewok
Copy link
Contributor

erewok commented Jun 21, 2020

I was experimenting with something in this library and while trying to run the tests, I hit this same bug on OSX 10.15.5 (Catalina). After hunting around for awhile, I followed the same path, signing JWTs invokes cryptonite which opens /dev/urandom... (I landed here because it's the only googleable result that matches.)

Ultimately, I got around this by running ulimit -n 2048 in the same shell where I was running tests because OSX has a file descriptor limit of 256 for shell processes, but I'm still puzzled. If anyone comes here from the future, that's what I did... 🤷‍♀️

@domenkozar domenkozar reopened this Jun 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants