Skip to content

test: cover the shutdown-report drop and the worker wrapper's false result - #109

Merged
phcorp merged 2 commits into
mainfrom
test/shutdown-drop-and-worker-result
Nov 29, 2026
Merged

phcorp merged 2 commits into
mainfrom
test/shutdown-drop-and-worker-result

Conversation

@phcorp

@phcorp phcorp commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Closes the remaining test gaps from the last reviews. No runtime source changes.

  • Shutdown-report drop (fix: raise worker-end fatals, drop shutdown-report fatals, chain interrupts first #102), now tested. session_set_save_handler() registers a shutdown function by default, so earlier attempts saw the session flush before any module shutdown and passed with or without the fix. With register_shutdown: false, the session module, which shuts down after this extension (Zend runs RSHUTDOWN in reverse registration order), calls the user handler after the automatic report. A new allowed-shutdown fault fails only shutdown-phase basedir checks. The test requires write and close both to run; without the profiler_reset_clocks() in request shutdown, close is lost.
  • Worker wrapper's false (fix: type the worker wrapper's early returns and raise deferred fatals first #106), now tested. With observers the end observer raises before anyone reads the result, but without them nothing does at the call's end. The unit build now also registers its contracts with the closure-identity slot, so worker-materialize and worker-end run with observer=0 and require IS_FALSE with the fatal still pending. Reverting RETURN_FALSE to return fails them.
  • Test cleanup. automatic_worker_serve_with() releases its strings when a bailout passes.

Checked and closed without code: under observer=Off on platforms without the sampling interrupt hook, no path defers a fatal error that nothing raises. No session can start, the worker wrapper is not registered, request startup raises its own, and shutdown drops its own on purpose.

…esult

A session handler registered without a shutdown function makes the session
module, which shuts down after this extension, call user code after the
automatic report: with a fault in that report's basedir check, write() and
close() must still run. The unit build also registers its contracts with
observers Off, so the worker modes check the wrapper's false result while
the fatal error is still pending. The worker test helper releases its
strings when a bailout passes.
… function

Renaming profiler_register_closure_identity() in the unit build dropped a
mutant from the test inventory. The sampling unit's registration, which
startup runs in both modes, now registers the bridge unit's contracts when
observers are Off. The Off worker checks accept the sampling interrupt
hook's raise where the platform has one.
@phcorp
phcorp force-pushed the test/shutdown-drop-and-worker-result branch from 95a50cf to b5bc51e Compare November 29, 2026 15:58
@phcorp
phcorp merged commit 65179da into main Nov 29, 2026
53 checks passed
@phcorp
phcorp deleted the test/shutdown-drop-and-worker-result branch November 29, 2026 16:35
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