Skip to content

Timestamp compat binary output when it is written - #733

Draft
todthomson wants to merge 2 commits into
todthomson/lev-2253-non-blocking-compat-consolefrom
todthomson/lev-2253-timestamp-compat-console
Draft

todthomson wants to merge 2 commits into
todthomson/lev-2253-non-blocking-compat-consolefrom
todthomson/lev-2253-timestamp-compat-console

Conversation

@todthomson

Copy link
Copy Markdown
Member

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

  • NonBlockingConsole now 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 when WriteLine is called, not when the line reaches stdout.
  • In a trace log, each compat line now carries both times:
    08:13:31.945 +00:00 HalibutRuntimeBuilder [compat 08:13:31.939Z] Listening on port: 34755
    The 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.
  • CompatBinaryLogLine owns the format and is linked into Halibut.Tests.
  • HalibutTestBinaryRunner and ProxyHalibutTestBinaryRunner log the line as received, timestamp included. They strip the prefix before parsing Listening on port: , Polling listener is listening on port: and RunningAndReady. Without the strip, the port regex would pick up the timestamp's digits.
  • Lines written without a prefix pass through unchanged, e.g. FixHungWebSocketsHack's direct console write.
  • CompatBinaryLogLineFixture covers the format, stripping it, and stamping at write time rather than read time.

Relates to Linear LEV-2253.

How to review this PR

Quality ✔️

  • Built Halibut.TestUtils.CompatBinary.Base for both net48 and net10.0 locally.
  • On Linux (net10.0) I ran the new fixtures, plus the UsageFixture EchoService / SupportedServices compat cases. All 46 passed, and the trace logs show the [compat …Z] prefix.
  • net48 on Windows hasn't been run yet; that needs CI.

Pre-requisites

  • I have read How we use GitHub Issues for help deciding when and where it's appropriate to make an issue.
  • I have considered informing or consulting the right people, according to the ownership map.
  • I have considered appropriate testing for my change.

Generated by Claude Code

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
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants