radicle-node: cap test threads to fix timing-sensitive tests

The rad_init_sync_preferred test has a 5-second timeout waiting for
RefsSynced events. On loaded builders with many parallel tests, this
timeout can be exceeded causing test failures.

Cap RUST_TEST_THREADS to 4 (or NIX_BUILD_CORES if lower) to reduce
contention and give timing-sensitive sync tests a better chance of
completing within their timeouts.
This commit is contained in:
Jörg Thalheim
2025-12-23 12:38:47 +00:00
parent d222d01cd2
commit d6940654f1
+6
View File
@@ -67,6 +67,12 @@ rustPlatform.buildRustPackage (finalAttrs: {
export PATH=$PATH:$PWD/target/${stdenv.hostPlatform.rust.rustcTargetSpec}/release
# Tests want to open many files.
ulimit -n 4096
# Cap test threads to avoid timing issues on loaded builders (sync timeout is 5s)
max_threads=4
if [[ -n "$NIX_BUILD_CORES" && "$NIX_BUILD_CORES" -lt "$max_threads" ]]; then
max_threads=$NIX_BUILD_CORES
fi
export RUST_TEST_THREADS=$max_threads
'';
checkFlags = [
"--skip=service::message::tests::test_node_announcement_validate"