Repository navigation
Timestamp compat binary output when it is written - #733
Draft
todthomson wants to merge 2 commits into
Draft
todthomson wants to merge 2 commits into
todthomson wants to merge 2 commits into
Conversation
The test process timestamps compat binary lines when it reads them, so trace logs can't tell 'the compat binary stopped writing' apart from 'the test process stopped reading' (LEV-2253). NonBlockingConsole now prefixes each line with the UTC time it was written, e.g. '[compat 12:28:14.740Z] ...'. CompatBinaryLogLine owns the format and is linked into Halibut.Tests, where the binary runners strip the prefix before parsing startup lines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CQ12H5eAC2buLoec1L71V
Covers the timestamp prefix format, stripping it (and leaving unprefixed lines alone), and that NonBlockingLineWriter stamps lines when WriteLine is called rather than when they reach the target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CQ12H5eAC2buLoec1L71V
|
|
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.
Background
Stacked on #732, so review and merge that first. This PR's base is #732's branch, so the diff shows only this change.
In the LEV-2253 trace logs, every compat binary line carries the time the test process read it. The compat binary writes nothing of its own, so a trace can't distinguish "the compat binary stopped writing" from "the test process stopped reading". Telling those two apart is exactly the open question in LEV-2253.
Results
NonBlockingConsolenow prefixes every compat binary stdout line with the UTC time it was written, e.g.[compat 12:28:14.740Z] Listening on port: 53024. The time is captured whenWriteLineis called, not when the line reaches stdout.08:13:31.945 +00:00 HalibutRuntimeBuilder [compat 08:13:31.939Z] Listening on port: 34755The first time is when the test read the line, and the bracketed time is when the compat binary wrote it. A gap between the two is a reader stall.
CompatBinaryLogLineowns the format and is linked intoHalibut.Tests.HalibutTestBinaryRunnerandProxyHalibutTestBinaryRunnerlog the line as received, timestamp included. They strip the prefix before parsingListening on port:,Polling listener is listening on port:andRunningAndReady. Without the strip, the port regex would pick up the timestamp's digits.FixHungWebSocketsHack's direct console write.CompatBinaryLogLineFixturecovers the format, stripping it, and stamping at write time rather than read time.Relates to Linear LEV-2253.
How to review this PR
Quality ✔️
Halibut.TestUtils.CompatBinary.Basefor both net48 and net10.0 locally.UsageFixtureEchoService / SupportedServices compat cases. All 46 passed, and the trace logs show the[compat …Z]prefix.Pre-requisites
Generated by Claude Code