redisTestHook,memcachedTestHook: init; prevent hanging Darwin build after test failures#357879
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
|
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. |
b9c82ff to
6d78b3f
Compare
|
@mweinelt Redis socket support is now ready. However, Memcached works with either a network connection or a socket, it doesn't accept connections on both: https://docs.memcached.org/serverguide/configuring/#unix-sockets Do you think it would still be useful to add a socket-only mode to |
|
We can probably revisit UDS later. |
mweinelt
left a comment
There was a problem hiding this comment.
Looks good. Just some minor things left.
There was a problem hiding this comment.
| cli = "${redis}/bin/redis-cli"; | |
| server = "${redis}/bin/redis-server"; | |
| cli = lib.getExe' redis "redis-cli"; | |
| server = lib.getExe' redis "redis-server"; |
There was a problem hiding this comment.
| memcached = "${lib.getExe memcached}"; | |
| nc = "${lib.getExe netcat}"; | |
| memcached = lib.getExe memcached; | |
| nc = lib.getExe netcat; |
There was a problem hiding this comment.
redis-cli seems to be a bit noisy printing connection errors, while waiting for redis-server to start
django-cacheops> starting redis
django-cacheops> waiting for redis to be ready
django-cacheops> Could not connect to Redis at /build/run/redis.sock: No such file or directory
There was a problem hiding this comment.
Do you have a better idea than 2>/dev/null? I'm afraid it would make eventual debugging a nightmare. Maybe we should sleep 1 first once?
There was a problem hiding this comment.
We could check whether the socket exists (test -s "$REDIS_SOCKET") or the listener has bound to the port (nc -z localhost "$redisTestPort") before interrogating it with redis-cli. 🤔
|
And please check if you have removed unused |
6d78b3f to
b9f900e
Compare
398c99d to
718cf5d
Compare
|
Eval failure in |
718cf5d to
44ba8fd
Compare
|
Thank you! |
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
checkPhasefails (thuspostChecknever 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 = relaxedsandbox = truenix-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.