Repository navigation
Description
test-asan-nix_2_31 does not finish. It hits the 60 minute cap of
caps.asanSuite with about a third of the suite done, and 19 of the tests it
does reach fail. Both facts have one cause, and it is not a defect of the code
under test.
Measured in run 30860160011 and again in run 30883251498. The two runs carry
different code, and the numbers are the same, so this predates both.
What happens
19 tests fail, and they are all flake tests or LSP tests:
tests/pynix/test_build.py::test_build_flake_derivation
tests/pynix/test_derivation_show.py::test_show_flake
tests/pynix/test_derivation_show.py::test_show_flake_greeting_is_not_derivation
tests/pynix/test_flake_show.py::test_flake_info_aliases_metadata
tests/pynix/test_flake_show.py::test_flake_metadata_json_does_not_write_lock_file
tests/pynix/test_flake_show.py::test_flake_show_root
tests/pynix/test_flake_show.py::test_flake_show_with_a_separate_attrpath_flag_navigates_further
tests/pynix/test_flake_show.py::test_flake_show_with_hash_attrpath
tests/pynix/test_lsp.py::test_bare_attrpath_completion_falls_back_to_the_options_tree
tests/pynix/test_lsp.py::test_completion_lists_real_schema_attribute_names_for_a_resource_type
tests/pynix/test_lsp.py::test_completion_resolves_options_through_a_full_module_system_eval
tests/pynix/test_lsp.py::test_hover_falls_back_to_the_last_error_free_parse
tests/pynix/test_lsp.py::test_hover_on_a_bare_definition_key_shows_the_declared_option
tests/pynix/test_lsp.py::test_hover_resolves_a_cross_resource_reference_inside_a_tfref_string
tests/pynix/test_lsp.py::test_hover_shows_provider_schema_description_for_a_resource_attribute
tests/pynix/test_lsp.py::test_pkgs_completion_lists_real_nixpkgs_attributes
tests/pynix/test_lsp.py::test_progressive_completion_after_typing_a_trailing_dot
tests/nanopynix/test_store_exec.py::test_inproc_a_program_in_a_relocated_store_runs_through_the_exec_prefix
tests/nanopynix/test_store_exec.py::test_rpc_a_program_in_a_relocated_store_runs_through_the_exec_prefix
Each one takes about two minutes, and each one ends the same way:
a Nix operation did not answer an interrupt within 2.0s; abandoning the Nix thread.
closing an abandoned evaluator (handle 2) without its Nix teardown; its EvalState leaks
closing an abandoned Nix executor: a Nix operation did not answer an interrupt within 2.0s.
Why
The 2.0 second interrupt deadline is a wall-clock number, and ASAN makes
every evaluation slower than it. An evaluation that answers its interrupt in
milliseconds without instrumentation does not answer within two seconds with
shadow memory for each allocation. The test then waits out its own deadline,
abandons the evaluator, and fails. Two minutes each, seventeen times over, is
most of the hour that the job does not have.
The two test_store_exec failures do not fit that description, and they need
their own look.
What to decide
Three things, and they are not exclusive:
- Give the deadline a scale for an instrumented build. The number belongs
to the code, and not to the test. A build that runs 10 to 50 times slower
needs a deadline that says so, andbuild_infoalready publishes the
capabilities that would tell it. - Raise
caps.asanSuite. The suite needs the time whatever the deadline
does. 686 tests took 43 minutes, so the whole suite needs about two hours at
the present speed. - Select what the ASAN job runs. ASAN answers a memory question, and an
LSP round trip is a poor way to ask it.
#73 records that the LSP tests time out non-deterministically in CI. This is
the deterministic version of the same thing, it reaches the flake tests as
well, and it has a cause that #73 does not name.
Acceptance
test-asan-nix_2_31reaches the end of whatever selection it runs, inside
its cap.- No test fails with "did not answer an interrupt within 2.0s" on an
instrumented build. - The two
test_store_execfailures are explained, and either corrected or
recorded with a reason.
Activity
fix(ci): tell ASAN that Nix switches to a coroutine stack
test(asan): run only the failing files, to get their tracebacks
fix(tests): give the ASAN job deadlines an instrumented build can meet
Lillecarl commentedon Aug 4, 2026
Correction: the cause above is wrong
The issue text blames a 2.0 second interrupt deadline. That was a guess made
from the terse CI log, and it is wrong. This corrects it with the tracebacks.
No traceback existed until now, and that is why the guess stood. The job
already passes
--tb=short -rsxXfE, but pytest prints its FAILURES section atthe end of a run, and this job never reached the end:
caps.asanSuitekilledit first. So the log and the artifact carried
FAILEDand nothing else.Run 30891726124 ran only the five files that hold every failure. It finished,
in 50 minutes, and printed them: 22 failed, 63 passed.
The four real causes
nanopynix.exceptions.NixError: (<Status.DEADLINE_EXCEEDED: 4>, ...)NANOPYNIX_RPC_TIMEOUT=120, under a default of 300TimeoutErrortests/conftest.py, which nobody overrodeAssertionError: exited 1/bin/shunderLD_PRELOADThe nine are the cascade. Each carries this in its captured log:
An earlier timeout takes the LSP server down, and every later LSP test then
reads
Nonefrom a server that is no longer there. Correct the deadlines andthese go with them.
shutdown_timeoutis the one worth naming.nanopynix/settings.py:798gives it a default of 5.0 seconds, and no variant of this job has ever set it.
An ASAN worker had five seconds to answer
Shutdown, and the trace of thefirst flake failure ends exactly there:
The two
exited 1are not a deadline at all.tests/nanopynix/test_store_exec.pywrote a#!/bin/shscript and exec'd it.ASAN sets
LD_PRELOADto its runtime, that reaches every child, and theruntime links against the glibc of this closure, so the host shell got two
glibcs.
nix/sanitizer.nixalready records this failure against the host git.What changed
NANOPYNIX_RPC_TIMEOUT120 -> 600,NANOPYNIX_SHUTDOWN_TIMEOUTunset -> 120,NANOPYNIX_TEST_TIMEOUTunset -> 900.test_store_exec.pytakessys.executablerather than/bin/sh. Theinterpreter is incidental to what that test asks.
caps.asanSuite60 -> 120, for the measurement run.What this issue still needs
Every number above is generous on purpose, and a deadline exists to make a
hang visible. Bring each one down to what this job measures once it is green,
and bring
caps.asanSuitedown with them.shutdown_timeoutdeserves a second look beyond this job. 5 seconds is aproduct default, not a test one, and no sanitized variant sets it. The TSAN
and UBSan jobs pass today, so 5 seconds holds there, but nothing says it holds
on a slow machine.
perf(ci): give the ASAN job the tests that ASAN can report on
fix(tests): give the ASAN job deadlines an instrumented build can meet
perf(ci): give the ASAN job the tests that ASAN can report on
Lillecarl commentedon Aug 5, 2026
Every acceptance criterion holds now. Measured on run
31043196896,
job
92432294037(test-asan-nix_2_31), the job this issue names.1. "reaches the end of whatever selection it runs, inside its cap."
The job ran from 20:15:28 to 20:38:36, so 23 minutes against a
caps.asanSuiteof 60. pytest reported1688 passed, 110 skipped, 2 deselected, 1 xfailed in 1208.19s, and itreached the summary. The other three ASAN jobs are the same shape.
2. "No test fails with 'did not answer an interrupt within 2.0s'."
The string appears zero times in the logs of
test-asan-nix_2_31andtest-asan-nix_2_35. None of the 19 tests this issue lists runs in the ASANjob any more.
3. "The two
test_store_execfailures are explained, and either correctedor recorded with a reason." Corrected.
tests/nanopynix/test_store_exec.py:36-52carries the reason: the test ranthe host
/bin/sh, and a host program cannot load under theLD_PRELOADofthe sanitizer runtime. The tests take
sys.executablefrom this closure now,and they pass in all four ASAN jobs.
What did it
The third option of "What to decide" — select what the ASAN job runs.
ci/workflows/lib.nix:735takestests/pynixout, and gives the measurementbehind the cut: two hours of ASAN over that directory found 0 sanitizer
reports, and all ten of its failures were there. The same block raises three
deadlines for an instrumented build, which answers the first option for the
tests that stayed.
What is left
test-asan-*is still red, on one test only:test_the_registration_makes_a_store_that_never_saw_the_paths_valid. That isthe same host-
/bin/shfailure as criterion 3, in a second place, and it hasits own issue: #121.
Closing. Reopen this if the ASAN job goes back over its cap.
fix(ci): tell ASAN that Nix switches to a coroutine stack
fix(tests): give the ASAN job deadlines an instrumented build can meet
perf(ci): give the ASAN job the tests that ASAN can report on
refactor(huggorm-dsl): a Decl is frozen
refactor(huggorm-dsl): a Decl is frozen