Skip to content

fix(testserver): report a silenced output, and rename the never-rendered status - #2494

Merged
schloerke merged 2 commits into
mainfrom
schloerke/fix-test-server-issues
Sep 11, 2026
Merged

schloerke merged 2 commits into
mainfrom
schloerke/fix-test-server-issues

Conversation

@schloerke

Copy link
Copy Markdown
Collaborator

Fixes both test_server() status issues; they are coupled, since the second frees the name the first needs.

#2492 — a silent req() failure is invisible

set_silent() left the test-mode record untouched, so get_output() kept reporting the previous render's value with status="ok" while the browser blanked the output. A test could pass while asserting a value the user cannot see.

OutBoundMessageQueues now records the suppression as its own fact in test_silent, discarded as soon as the output computes a value or errors again. test_values/test_errors still retain the last computed value (Shiny for R parity), so _build_test_snapshot() and the HTTP snapshot are unchanged — only test_server reads the new set, the same way it already reads test_tracebacks.

ts.set_inputs(n=1)
assert ts.get_output("txt") == "ok: 1"
ts.set_inputs(n=-1)                                # fails req()
assert ts.get_output("txt").status == "silent"     # now true
assert ts.get_output("txt").value is MISSING       # no stale value

#2493 — "silent" meant "never rendered"

With silence observable, "silent" now means what Shiny already taught: this render produced nothing. The state it used to name — an output that has not run at all — is "never-rendered".

In practice most outputs that used to report "silent" still do, because reading an unset input raises a SilentException. "never-rendered" is the narrower state of an output whose effect never ran, e.g. a hidden (suspended) one.

__eq__ now has a distinct message per state; keys()/dict()/repr() treat both the same as before (no value, no error).

No changelog entry: test_server() is itself unreleased (#2470), so its documented behavior is just what ships.

Verification

.venv/bin/python -m pytest tests/pytest -q → 1208 passed, 1 skipped. uv run make format check-lint check-types and make check-pyright clean. New tests cover the silenced-after-ok transition, the never-rendered state, and the queue-level clearing rules; the bundled shiny-for-python skill's status table is updated.

…red status

`test_server()` could not see a `req()` failure: `set_silent()` left the
test-mode record alone, so `get_output()` kept reporting the previous
render's value with `status="ok"` while the browser blanked the output.

`OutBoundMessageQueues` now records the suppression itself in
`test_silent`, cleared as soon as the output computes a value or errors
again. `test_values`/`test_errors` still keep the last computed value
(Shiny for R parity), so the snapshot served over HTTP is unchanged.

With silence observable, `"silent"` now means what Shiny already taught:
this render produced nothing. The state it used to name -- an output that
has not run at all -- is now `"never-rendered"`.

Closes #2492, closes #2493
@schloerke
schloerke enabled auto-merge (squash) September 11, 2026 21:42
@schloerke
schloerke merged commit 91cd46f into main Sep 11, 2026
175 checks passed
@schloerke
schloerke deleted the schloerke/fix-test-server-issues branch September 11, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant