-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
redisTestHook,memcachedTestHook: init; prevent hanging Darwin build after test failures #357879
base: staging
Are you sure you want to change the base?
Conversation
269df0a
to
1444c42
Compare
It seems this PR adds almost the same code to the |
I was thinking the same, but I'm not familiar enough with nixpkgs to know how to approach this. Do you have a specific idea in mind? Maybe a hook? |
I asked in the NixOS dev room and emily suggested a hook indeed. And in addition to mark the failing packages as broken or badPlatforms. |
Create a hook to integrate redis into the check phase. Check out |
Emily also mentioned the following:
I'm not sure |
1444c42
to
52fcb42
Compare
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.
Thanks, that looks pretty good already!
```nix | ||
{ stdenv, memcachedTestHook }: | ||
stdenv.mkDerivation { | ||
# ... | ||
nativeCheckInputs = [ | ||
memcachedTestHook | ||
]; | ||
} | ||
``` |
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.
Please format codeblocks with nixfmt-rfc-style.
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.
Fixed, as well as the redis hook docs
Bash-only variables: | ||
|
||
- `redisTestPort`: Port to use by Redis. Defaults to `6379` |
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.
Can we also expose redis over a unix domain socket?
Bash-only variables: | ||
|
||
- `memcachedTestPort`: Port to use by Memcached. Defaults to `11211` |
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.
Please also expose the unix domain socket.
MEMCACHED_PID=$! | ||
|
||
while ! (echo 'quit' | nc localhost "$memcachedTestPort") ; do | ||
echo 'waiting for memcached to be ready' |
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.
I think we can just print that once, otherwise it could become very spammy on busy builders.
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.
Fixed, as well as in redisHook
propagatedBuildInputs = [ | ||
memcached | ||
netcat | ||
]; |
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.
I'm not entirely sure we want to propagate these packages. We could just use buildInputs
, no? Or use replaceVars
on the hook script.
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.
True, I pushed a fix using substitutions
(makeSetupHook
has no buildInputs
)
b1bfc93
to
b397670
Compare
b397670
to
d267cec
Compare
Thank you for the review @mweinelt. The easier ones are fixed now. Next, I'll figure out the unix domain socket thing and then resolve the merge conflict. |
Looking at Hydra's "timed out jobs" list, I noticed many Darwin timeouts where the last log lines were all about Redis. It turns out the background Redis job is not terminated correctly on macOS when
checkPhase
fails (thuspostCheck
never runs).I reviewed all Redis test usage in pkgs and added the same workaround, as well as connection retry where it was missing.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.