You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
tests/nanopynix/test_hostile_inputs.py, 18 tests. The subject is the class
and the wording, not the fact that a bad input fails — every input here
already failed somehow. Three answers were wrong:
stores.parse and StoreConfig.uri promise ValueError, and leaked UsageError. An unknown scheme and an unknown parameter already answered ValueError. A URI Nix itself cannot read answered Nix's own UsageError,
a RuntimeError from the compiled bindings carrying terminal colour codes.
Which half of the URI was at fault chose the exception class.
The worker answered an evaluator handle it never issued with "no EvalState
is open — call OpenEval before evaluating". One had been opened. Handle
0 is the wire's "none" and keeps that message; any other number now names
the handle and says what happened to it.
A settings value Nix refuses left the whole worker behind. WorkerClient.open spawns the process, opens the channel and starts the log
task before Nix is asked to take the settings. Nix refuses, open raises,
and Python does not run __aexit__ for an __aenter__ that raised — so
nothing closed any of the three. The worker stayed alive holding a Nix store
connection nothing in this process remembered.
The third one was not in the issue. It surfaced as an intermittent failure of
the settings test: the abandoned channel raised StreamTerminatedError in a
task nobody awaited, and whether the garbage collector noticed before the test
ended decided which test the report landed on. That chase also found a second
leak one layer down, in grpclib-transports: killing a worker left LogicalRpcPeer.aclose unable to reap its own reader task, because _receive_loop sets _closed in its finally and the guard at the top of aclose then made the one call that reaps it a no-op. Fixed upstream in 84e5fcd6,
and the flake input is bumped here. Measured: 5 of 5 leaks before, 0 of 5
after.
Two answers are recorded as they are rather than corrected, each with the
reason in the test:
An unknown value handle still answers a bare KeyError. Changing it
changes what crosses boundary B, and WIRE_CLASSES in test_exceptions_classify.py with it.
An unknown experimental feature still answers a bare RuntimeError. nix_util.cpp throws it before Nix is asked, so nothing translates it, and tests/nanopynix/bindings/test_util.py pins that as the binding's own
contract.
Both are written down where a caller meets them, so the asymmetry is visible
rather than surprising.
Activity
test(rpc): round-trip the wire types, and cut a quadratic trimmer
Lillecarl commentedon Aug 2, 2026
Done in
b281f185tests/nanopynix/test_hostile_inputs.py, 18 tests. The subject is the classand the wording, not the fact that a bad input fails — every input here
already failed somehow. Three answers were wrong:
stores.parseandStoreConfig.uripromiseValueError, and leakedUsageError. An unknown scheme and an unknown parameter already answeredValueError. A URI Nix itself cannot read answered Nix's ownUsageError,a
RuntimeErrorfrom the compiled bindings carrying terminal colour codes.Which half of the URI was at fault chose the exception class.
is open — call OpenEval before evaluating". One had been opened. Handle
0 is the wire's "none" and keeps that message; any other number now names
the handle and says what happened to it.
WorkerClient.openspawns the process, opens the channel and starts the logtask before Nix is asked to take the settings. Nix refuses,
openraises,and Python does not run
__aexit__for an__aenter__that raised — sonothing closed any of the three. The worker stayed alive holding a Nix store
connection nothing in this process remembered.
The third one was not in the issue. It surfaced as an intermittent failure of
the settings test: the abandoned channel raised
StreamTerminatedErrorin atask nobody awaited, and whether the garbage collector noticed before the test
ended decided which test the report landed on. That chase also found a second
leak one layer down, in
grpclib-transports: killing a worker leftLogicalRpcPeer.acloseunable to reap its own reader task, because_receive_loopsets_closedin itsfinallyand the guard at the top ofaclosethen made the one call that reaps it a no-op. Fixed upstream in84e5fcd6,and the flake input is bumped here. Measured: 5 of 5 leaks before, 0 of 5
after.
Two answers are recorded as they are rather than corrected, each with the
reason in the test:
KeyError. Changing itchanges what crosses boundary B, and
WIRE_CLASSESintest_exceptions_classify.pywith it.RuntimeError.nix_util.cppthrows it before Nix is asked, so nothing translates it, andtests/nanopynix/bindings/test_util.pypins that as the binding's owncontract.
Both are written down where a caller meets them, so the asymmetry is visible
rather than surprising.
test(rpc): round-trip the wire types, and cut a quadratic trimmer
test(nanopynix): what each entry point answers for input that is wrong