8000 ci: the ASAN suite times out, because a 2.0s interrupt deadline is unreachable under ASAN · Issue #90 · nixidae/nixidae · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

ci: the ASAN suite times out, because a 2.0s interrupt deadline is unreachable under ASAN #90

Closed

Description

@Lillecarl

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, and build_info already 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_31 reaches 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_exec failures are explained, and either corrected or
    recorded with a reason.

Refs #64, #73, #76.

Activity

  1. Lillecarl commented on Aug 4, 2026

    @Lillecarl
    ContributorAuthor

    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 at
    the end of a run, and this job never reached the end: caps.asanSuite killed
    it first. So the log and the artifact carried FAILED and 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

    n failure cause
    6 nanopynix.exceptions.NixError: (<Status.DEADLINE_EXCEEDED: 4>, ...) the job set NANOPYNIX_RPC_TIMEOUT=120, under a default of 300
    5 TimeoutError the 120 second deadline of tests/conftest.py, which nobody overrode
    9 assert None is not None a cascade, and not nine defects
    2 AssertionError: exited 1 /bin/sh under LD_PRELOAD

    The nine are the cascade. Each carries this in its captured log:

    ERROR pygls.protocol.json_rpc:json_rpc.py:525 Unable to send data, no available transport!
    

    An earlier timeout takes the LSP server down, and every later LSP test then
    reads None from a server that is no longer there. Correct the deadlines and
    these go with them.

    shutdown_timeout is the one worth naming. nanopynix/settings.py:798
    gives 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 the
    first flake failure ends exactly there:

    nanopynix/rpc/client/_pool.py:360: in close
        await self.invoke(self.worker_stub.shutdown, ShutdownRequest(), timeout=self._shutdown_timeout)
    ...
    asyncio.exceptions.CancelledError: Cancelled via cancel scope ...; reason: deadline exceeded
    

    The two exited 1 are not a deadline at all.

    /bin/sh: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_ABI_DT_X86_64_PLT'
    not found (required by /nix/store/...-glibc-2.42-67/...)
    

    tests/nanopynix/test_store_exec.py wrote a #!/bin/sh script and exec'd it.
    ASAN sets LD_PRELOAD to its runtime, that reaches every child, and the
    runtime links against the glibc of this closure, so the host shell got two
    glibcs. nix/sanitizer.nix already records this failure against the host git.

    What changed

    • NANOPYNIX_RPC_TIMEOUT 120 -> 600, NANOPYNIX_SHUTDOWN_TIMEOUT unset -> 120,
      NANOPYNIX_TEST_TIMEOUT unset -> 900.
    • test_store_exec.py takes sys.executable rather than /bin/sh. The
      interpreter is incidental to what that test asks.
    • caps.asanSuite 60 -> 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.asanSuite down with them.

    shutdown_timeout deserves a second look beyond this job. 5 seconds is a
    product 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.

  2. Lillecarl commented on Aug 5, 2026

    @Lillecarl
    ContributorAuthor

    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.asanSuite of 60. pytest reported
    1688 passed, 110 skipped, 2 deselected, 1 xfailed in 1208.19s, and it
    reached 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_31 and
    test-asan-nix_2_35. None of the 19 tests this issue lists runs in the ASAN
    job any more.

    3. "The two test_store_exec failures are explained, and either corrected
    or recorded with a reason."
    Corrected.
    tests/nanopynix/test_store_exec.py:36-52 carries the reason: the test ran
    the host /bin/sh, and a host program cannot load under the LD_PRELOAD of
    the sanitizer runtime. The tests take sys.executable from 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:735 takes tests/pynix out, and gives the measurement
    behind 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 is
    the same host-/bin/sh failure as criterion 3, in a second place, and it has
    its own issue: #121.

    Closing. Reopen this if the ASAN job goes back over its cap.

  3. added
    source: nanopynix
    on Oct 19, 2026
  4. added theissue type on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    source: nanopynix

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0