File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5656 DRAIN_DEADLINE_SECONDS ,
5757 GRACE_TICK_SECONDS ,
5858 HANDSHAKE_TIMEOUT_SECONDS ,
59- )
60- from render_machine .terminal_process import NO_INPUT_NOTE as DEFAULT_NO_INPUT_NOTE
61- from render_machine .terminal_process import (
6259 OWNER_PARENT ,
6360 OWNER_READER ,
6461 POLL_INTERVAL_SECONDS ,
162159# reaches only processes sharing the caller's console and the target is on the pseudoconsole.
163160CONTROL_C_BYTE = b"\x03 "
164161
165- # The absent-input note this backend adds to, stated where the asymmetry is documented: a
166- # script that reads input blocks until the execution timeout rather than seeing end-of-file.
167- NO_INPUT_NOTE = DEFAULT_NO_INPUT_NOTE + (
168- " On Windows the terminal carries no synthetic end-of-file, so such a script blocks until the "
169- "timeout instead of reading end-of-file."
162+ # The absent-input note this backend states itself, where the asymmetry is documented:
163+ # unlike the other backends it cannot hand the target end-of-file, so a script that reads
164+ # terminal input really does block until the execution timeout.
165+ NO_INPUT_NOTE = (
166+ " No input driver was attached to the script's terminal, and on Windows the terminal carries "
167+ "no synthetic end-of-file, so a script that waits for terminal input blocks until the timeout."
170168)
171169
172170
Original file line number Diff line number Diff line change 8383OWNER_PARENT = "parent"
8484OWNER_READER = "reader"
8585
86- # What a timeout diagnostic says when no input driver was attached. A backend that gives
87- # the target end-of-file at spawn needs nothing more; ConPTY, which cannot, appends its own
88- # clause to this one .
86+ # What a timeout diagnostic says when no input driver was attached. A backend that hands
87+ # the target end-of-file at spawn needs nothing more; ConPTY, which cannot deliver an
88+ # end-of-file, states its own note instead .
8989NO_INPUT_NOTE = (
90- " No input driver was attached to the script's terminal, so a script that waits for input "
91- "never receives any and runs to the timeout ."
90+ " No input driver was attached to the script's terminal; a script that reads terminal "
91+ "input is handed end-of-file rather than left waiting for it ."
9292)
9393
9494
Original file line number Diff line number Diff line change @@ -382,10 +382,12 @@ def test_windows_selects_the_conpty_backend(monkeypatch):
382382
383383def test_the_backend_notes_that_it_has_no_synthetic_end_of_file ():
384384 """The timeout diagnostic asks the backend that ran, so this one has to state the
385- asymmetry itself: a script reading input blocks instead of seeing end-of-file."""
385+ asymmetry itself: a script reading input blocks instead of seeing end-of-file — the
386+ base note describes backends that hand end-of-file at spawn, which this one cannot."""
386387 note = ConPtyProcess ().no_input_note ()
387388
388- assert note .startswith (NO_INPUT_NOTE )
389+ assert note != NO_INPUT_NOTE
390+ assert "blocks until the timeout" in note
389391 assert "end-of-file" in note
390392
391393
You can’t perform that action at this time.
0 commit comments