Skip to content

test: make DebugTelemetry span ordering deterministic#1030

Open
merkulovlad wants to merge 1 commit into
google:mainfrom
merkulovlad:fix/debugtelemetry-flaky-tests
Open

test: make DebugTelemetry span ordering deterministic#1030
merkulovlad wants to merge 1 commit into
google:mainfrom
merkulovlad:fix/debugtelemetry-flaky-tests

Conversation

@merkulovlad

Copy link
Copy Markdown

Link to Issue or Description of Change

1. Link to an existing issue (if applicable):

Testing Plan

The DebugTelemetry tests relied on timestamps assigned by the system clock.
Spans created in quick succession could receive equal start timestamps, causing
the stable start-time sort to preserve a nondeterministic input order.

This change assigns explicit, unique, increasing start timestamps to spans when
the tests expect a specific order. Production code and behavior are unchanged.

Unit Tests:

  • I have added or updated unit tests for my change.
  • All unit tests pass locally.

Passed locally:

go test ./server/adkrest/internal/services \
  -run '^TestDebugTelemetryGetSpansBy(SessionID|EventID)$' \
  -count=100

go test ./server/adkrest/internal/services
go test ./...
golangci-lint run ./server/adkrest/internal/services/...

Manual End-to-End (E2E) Tests:

N/A. This is a test-only change with no runtime behavior changes.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

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.

DebugTelemetry span ordering tests are flaky

1 participant