Skip to content

Make telemetry test collectors thread-safe - #1226

Merged
shanselman merged 1 commit into
mainfrom
shanselman-fix-telemetry-collector-race
Aug 25, 2026
Merged

shanselman merged 1 commit into
mainfrom
shanselman-fix-telemetry-collector-race

Conversation

@shanselman

Copy link
Copy Markdown
Collaborator

Replace callback-mutated List<T> collections in OpenClawTelemetryTests with ConcurrentQueue<T> and enqueue measurements from MeterListener callbacks. This prevents concurrent callback races without changing production telemetry behavior.

Validation

  • OpenClawTelemetryTests: 20 passed
  • .\build.ps1: passed
  • Shared tests: 3,813 passed, 32 skipped
  • Tray tests: 2,712 passed

Real behavior proof

The focused telemetry suite exercises both counter and histogram listener callbacks using the thread-safe collector implementation. All 20 telemetry tests pass, and the PR diff contains only tests/OpenClaw.Shared.Tests/Telemetry/OpenClawTelemetryTests.cs.

Use concurrent queues for MeterListener callback measurements so parallel callbacks cannot corrupt test collection state.

Co-authored-by: Copilot App <[email protected]>
@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@shanselman shanselman added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Aug 25, 2026
@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown

ClawSweeper status: review started.

I am starting a fresh review of this pull request: Make telemetry test collectors thread-safe This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@shanselman
shanselman merged commit df88b28 into main Aug 25, 2026
22 checks passed
@shanselman
shanselman deleted the shanselman-fix-telemetry-collector-race branch August 25, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant