feat: say how the browser died, not just that it is gone - #86
Open
nathanfallet wants to merge 1 commit into
Open
feat: say how the browser died, not just that it is gone#86nathanfallet wants to merge 1 commit into
nathanfallet wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
A failed start currently reports `alive=false`: we know Chrome is gone, not how it
went. The two possible deaths call for opposite investigations.
On the VMs failing in production on 27/08 the message is invariably:
never opened its debug port ... (pid=8932, alive=false). Browser stderr: <none>
Chrome starts, dies within 30s, and writes nothing. Whether it crashed or chose to
stop is exactly what we cannot tell today — and it decides where to look next.
Adds `Process.exitCodeOrNull()` on all four targets:
- jvm: `exitValue()`, which throws while the process lives — hence the null.
- mingw: `GetExitCodeProcess`, the same call `isAlive()` already uses.
- posix: null. Liveness there is `kill(pid, 0)`, which does not carry a status,
and nothing reaps the child to collect one.
- js: unsupported, like the other process functions.
The status is reported verbatim, with no interpretation. Reading it is the whole
point: we do not know yet which statuses this failure produces, and baking a guess
into every log line would make the instrumentation useless.
Message building moves to `StartFailure.kt` as two pure functions (`processFate`,
`browserStartFailureMessage`) covered by tests on any OS — the facts they report
come from platform calls no CI can exercise.
Nothing changes on the happy path: these are only called in the failure branch.
nathanfallet
force-pushed
the
feat/say-how-the-browser-died
branch
from
August 27, 2026 11:19
a7eac02 to
fb9b4be
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The problem
Since #83 a failed start reports
alive=false: we know Chrome is gone, not how it went. The two possible deaths call for opposite investigations.In production on 27/08, on the VMs still failing, the message is invariably:
Chrome starts, dies within 30s, and writes nothing. Did it crash, or did it stop on purpose? That decides where to look next, and today we cannot tell.
The change
Process.exitCodeOrNull()on all four targets:exitValue(), which throwsIllegalThreadStateExceptionwhile the process lives: that is exactly the "still running" case, reported asnull.GetExitCodeProcess, the same callisAlive()already uses;nullwhile it reportsSTILL_ACTIVE.null, deliberately: liveness there iskill(pid, 0), which does not carry a status, and nothing reaps the child to collect one.The status is reported verbatim, with no interpretation. There is a plausible reading of an exit 0 on Windows — Chrome hands its command line to an instance that already owns the same
--user-data-dirand quits without opening a port — but that is a hypothesis, not something this PR asserts. Reading the status is the whole point: we do not know yet which statuses this failure produces, and putting a guess in every log line would defeat the instrumentation.Scope
Message building moves to
StartFailure.ktas two pure functions,processFateandbrowserStartFailureMessage, so the wording is covered by tests on any OS — the facts they report come from platform calls no CI can exercise.Nothing changes on the happy path: both are only called in the failure branch.
Tests
Endpoint and pid always present; exit status reported verbatim for both 0 and non-zero; still-running said plainly; an unavailable status must not be reported as an exit code; stderr blank vs populated; last connection error.
All five targets compile,
:core:jvmTestgreen, detekt 317 findings, same as main.