Drop `xfail` from `test_moc_reentry_during_teardown`
The per-`ctx_key` locking fix in f086222d intended to resolve the
teardown race reproduced by the new test suite, so the test SHOULD now
pass. TLDR, it doesn't Bp
Also add `collapse_eg()` to the test's ctx-manager stack so that when
run with `pytest <...> --tpdb` we'll actually `pdb`-REPL the RTE when it
hits (previously an assert-error).
(this commit-msg was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
subint_spawner_backend
parent
4d3c5b9163
commit
febe587c6c
|
|
@ -12,6 +12,7 @@ import trio
|
||||||
import tractor
|
import tractor
|
||||||
from tractor.trionics import (
|
from tractor.trionics import (
|
||||||
maybe_open_context,
|
maybe_open_context,
|
||||||
|
collapse_eg,
|
||||||
)
|
)
|
||||||
from tractor.log import (
|
from tractor.log import (
|
||||||
get_console_log,
|
get_console_log,
|
||||||
|
|
@ -539,17 +540,6 @@ def test_per_ctx_key_resource_lifecycle(
|
||||||
trio.run(main)
|
trio.run(main)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.xfail(
|
|
||||||
reason=(
|
|
||||||
'Demonstrates the `_Cache.run_ctx` teardown race: '
|
|
||||||
'a re-entering task hits '
|
|
||||||
'`assert not resources.get(ctx_key)` because '
|
|
||||||
'`values` was popped but `resources` was not yet '
|
|
||||||
'(acm `__aexit__` checkpoint in between). '
|
|
||||||
'Fixed by per-`ctx_key` locking in 9e49eddd.'
|
|
||||||
),
|
|
||||||
raises=AssertionError,
|
|
||||||
)
|
|
||||||
def test_moc_reentry_during_teardown(
|
def test_moc_reentry_during_teardown(
|
||||||
debug_mode: bool,
|
debug_mode: bool,
|
||||||
loglevel: str,
|
loglevel: str,
|
||||||
|
|
@ -621,6 +611,7 @@ def test_moc_reentry_during_teardown(
|
||||||
debug_mode=debug_mode,
|
debug_mode=debug_mode,
|
||||||
loglevel=loglevel,
|
loglevel=loglevel,
|
||||||
),
|
),
|
||||||
|
collapse_eg(),
|
||||||
trio.open_nursery() as tn,
|
trio.open_nursery() as tn,
|
||||||
):
|
):
|
||||||
tn.start_soon(use_and_exit)
|
tn.start_soon(use_and_exit)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue