8000 Tests: worker-death coverage never kills a worker · Issue #41 · nixidae/nixidae · GitHub
[go: up one dir, main page]

Skip to content

Tests: worker-death coverage never kills a worker #41

Closed

Description

@Lillecarl

Crash isolation is the documented reason for the RPC engine to exist, and no
test sends a signal to the worker process.

Evidence

tests/nanopynix/rpc/client/test_workerpool.py:98,
test_worker_death_detection, force-closes the gRPC channel. Its own
comment says: "In multiprocessing mode, the worker is managed by
AsyncExitStack; kill via process is not directly exposed."

docs/nanopynix/architecture.md names the behaviour as the headline of the
engine: "a worker crash/OOM raises WorkerDiedError -- your process
survives."

Three distinct failures have no test:

  1. SIGKILL during a call, which is what the OOM killer does.
  2. An abort inside the worker on the Nix side, which is the SIGABRT case
    that the docstring of nanopynix.init_libstore describes for experimental
    features.
  3. Death while handles are outstanding. Do the finalizers of ValueProxy
    queue releases against a dead channel, and does Session.close() still
    finish?

Scope

WorkerClient already keeps self._worker_proc for this purpose
(rpc/client/_pool.py:405-411). Add an accessor for tests, and add three
tests:

  • Kill during an in-flight store.query_path_info, and expect
    WorkerDiedError.
  • Kill while an EvalSession holds resolved ValueProxy objects, then call
    session.close(). Expect no hang, no second exception, and a reaped
    process.
  • Open a fresh Session in the same process afterwards, and expect it to
    work.

Mark the tests concurrency, so that the ThreadSanitizer matrix runs them.

Risk

Low for the library. Medium for flakiness of the suite. Bound each test with
anyio.fail_after, and assert the class of the exception, not the message.

Acceptance criteria

All three tests pass on both store backends, and pass repeatedly under the
concurrency marker.

Finding F10 of CODE_IMPROVEMENT_PLAN.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    source: nanopynix

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0