Skip to content

test(logs): wait for the call-log save instead of a fixed poll in upstream-error-call-log-16558 - #17091

Merged
diegosouzapw merged 1 commit into
release/v3.8.52from
fix/release-v3.8.52-basereds-calllog-settle-20261018
Oct 18, 2026
Merged

diegosouzapw merged 1 commit into
release/v3.8.52from
fix/release-v3.8.52-basereds-calllog-settle-20261018

Conversation

@diegosouzapw

Copy link
Copy Markdown
Collaborator

Summary

tests/unit/upstream-error-call-log-16558.test.ts reads each call-log row back through a helper
that polled 200 × 20 ms (~4 s) for the row to settle. The row's detail artifact is written by a
worker thread (src/lib/usage/callLogArtifactWriter.ts) that starts cold on the first write; in a
source checkout it is spawned with --import tsx/esm. On a loaded machine that start took 8–20 s,
so the first one or two cases failed with attempt did not reach durable call-log detail.

persistAttemptLogs hands the row to saveCallLog synchronously, so the helper now awaits
waitForCallLogSaves() (row inserted and detail published: ready, or missing if the write
failed) with a 60 s bound that only turns a hung save into a failure, then asserts the row settled
and reads it. The assertions are unchanged; no production code is touched.

Evidence

Same class elsewhere (not changed here)

The worker comes online in ~0.1 s, but its first reply took 6.7–8.4 s on the devbox at load
3–5: tsx loads its import graph in the fresh thread (callLogArtifacts.ts pulls
open-sse/utils/requestLogger.ts). Other call-log readers have shorter bounds and fail the same
way there, also when run alone (--test-concurrency=1): call-logs-id-collision (10 s),
image-usage-accounting (5 s), copilot-learned-catalog-15634 (2 s), chatcore-attempt-logging,
chat-keepalive-correlation-functional, estimated-usage-billing-guard,
provider-request-failure-pipeline, and tests/integration/reasoning-routing-pipeline.test.ts
(harness waitFor, 1.5 s default). They pass on hosted CI. Left for a follow-up: move those
bounds onto the same barrier, or make the worker's import graph lighter.

Validation

  • Prettier and ESLint (with the suppressions file) clean.
  • Typecheck of the touched file: 0 errors (2 inherited in the imported
    open-sse/transformer/responsesTransformer.ts and open-sse/utils/sseHeartbeat.ts).

Refs #15306

⚠️ base-red inherited: #15306

…tream-error-call-log-16558

The detail artifact is written by a worker thread that starts cold on the first write; in a
source checkout it is spawned through tsx. On a loaded machine that start took 8-20 s, past the
helper's ~4 s polling budget (200 x 20 ms), so the first one or two cases failed with "attempt
did not reach durable call-log detail" (3/3 runs on the release tip, load ~6-7).

persistAttemptLogs hands the row to saveCallLog synchronously, so the helper now awaits
waitForCallLogSaves() (row inserted and detail published: 'ready', or 'missing' if the write
failed) with a 60 s bound that only turns a hung save into a failure, then asserts the row
settled. The assertions are unchanged.

Refs #15306
@github-actions

Copy link
Copy Markdown
Contributor

CI Coverage Report

  • Coverage job: skipped
  • PR test policy: success

Coverage artifact was not available for this run.

@diegosouzapw
diegosouzapw merged commit 8104726 into release/v3.8.52 Oct 18, 2026
50 of 65 checks passed
@diegosouzapw
diegosouzapw deleted the fix/release-v3.8.52-basereds-calllog-settle-20261018 branch October 18, 2026 22:17
diegosouzapw added a commit that referenced this pull request Oct 19, 2026
…sk cache (#17133)

In a source checkout the call-log artifact worker runs through tsx, and tsx indexes its whole disk
cache (os.tmpdir()/tsx-<uid>) with one readdirSync the first time a thread transforms a file. On a
shared dev box that directory reached ~585k entries and the worker's first write waited 5-7 s on
the listing (0.4 s without it). callLogWorkerOptions() now starts a tsx-launched worker with
TSX_DISABLE_CACHE=1 on top of the parent's environment; compiled workers (npm, standalone, Docker)
keep the default options.

Refs #17091, #17099
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