Repository navigation
Commit d5f2c1b
committed
test: Pin READY_ENDING after a default exit that raises
This is the one behavior change in the otherwise behavior-neutral
refactor in 716c90d, and this message replaces that commit's "behavior is
unchanged" wording: a failed default exit_environment() now leaves the
Session READY_ENDING instead of READY.
exit_environment() without keep_session_running sets _ending_only before
it stores RUNNING. If it raises in between, the Session used to report
READY with the flag set, so a later run_task, enter_environment or
run_subprocess was accepted and clear_ending_only() was refused. That is
the same "READY while ending-only" drift the refactor removes. It now
reports READY_ENDING: those three calls are refused, clear_ending_only()
is accepted, and only exits and cleanup remain, which is what the exit
asked for.
Calls with correctly typed arguments don't raise in that window. Only
wrongly typed arguments reach it through the public API, for example a
resolved_symtab that isn't a SerializedSymbolTable, or os_env_vars with a
non-string key. So the new test,
test_default_exit_that_raises_leaves_ready_ending, injects the failure
into _evaluate_current_session_env_vars, then checks that the stored
state is READY, the state property reads READY_ENDING, and run_task,
enter_environment and run_subprocess are refused. It fails at a299030,
where the state reads READY.
Full suite 1061 passed, 46 skipped, 16 xfailed; black, ruff and mypy
pass.
Signed-off-by: Mark Wiebe <399551+mwiebe@users.noreply.github.com>1 parent 03aa31f commit d5f2c1b
1 file changed
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
693 | 693 | | |
694 | 694 | | |
695 | 695 | | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
0 commit comments