Skip to content

Commit b3e5a5a

Browse files
committed
Clarify reconciler --task-timeout help text
The --task-timeout help described the value as a timeout for a scheduled task that has not been executed yet, implying a queueing deadline. The value is passed to fetch_task_output, which uses it as an output-inactivity timeout: it resets every time a line arrives and only fires after that many seconds with no further output. Reword the help so operators set it for the behaviour it actually controls. Spell out the queued-task case explicitly rather than only denying it is a queueing deadline: a queued task produces no output while it waits, so that wait is not excluded from the timeout -- it counts against it in full, which is the most likely way an operator hits it. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Roger Luethi <luethi@osism.tech>
1 parent a53251c commit b3e5a5a

2 files changed

Lines changed: 23 additions & 1 deletion

File tree

osism/commands/reconciler.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ def get_parser(self, prog_name):
4040
"--task-timeout",
4141
default=os.environ.get("OSISM_TASK_TIMEOUT", 300),
4242
type=int,
43-
help="Timeout for a scheduled task that has not been executed yet",
43+
help=(
44+
"Seconds to wait for further task output before giving up. "
45+
"This is an output-inactivity timeout (it resets on each line). "
46+
"A queued task emits no output while it waits to run, so that "
47+
"wait counts against this timeout in full."
48+
),
4449
)
4550
return parser
4651

tests/unit/commands/test_reconciler.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@
1212
from osism.commands import reconciler
1313

1414

15+
def test_task_timeout_help_describes_output_inactivity():
16+
cmd = reconciler.Sync(MagicMock(), MagicMock())
17+
parser = cmd.get_parser("test")
18+
help_text = next(
19+
action.help
20+
for action in parser._actions
21+
if "--task-timeout" in action.option_strings
22+
)
23+
24+
# The value bounds how long the client waits for further task output. Time
25+
# a task spends queued produces no output, so it counts against the
26+
# timeout rather than being excluded from it.
27+
assert "output" in help_text.lower()
28+
assert "scheduled task that has not been executed" not in help_text.lower()
29+
assert "queued" in help_text.lower()
30+
31+
1532
def test_sync_returns_nonzero_on_task_timeout():
1633
cmd = reconciler.Sync(MagicMock(), MagicMock())
1734
parsed_args = cmd.get_parser("test").parse_args([])

0 commit comments

Comments
 (0)