Skip to content

Add ETW session loss metrics integration tests#312

Merged
beaubelgrave merged 1 commit into
microsoft:mainfrom
utpilla:utpilla/add-etw-stats-integration-tests
Jul 21, 2026
Merged

Add ETW session loss metrics integration tests#312
beaubelgrave merged 1 commit into
microsoft:mainfrom
utpilla:utpilla/add-etw-stats-integration-tests

Conversation

@utpilla

@utpilla utpilla commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Changes

Adds two end-to-end integration tests for the ETW session loss metrics API (one_collect::etw::query_stats / SessionStats) in a new file, etw_stats_integration.rs.

  • query_stats_reports_zero_loss_for_healthy_session: a draining consumer with default buffers must not drop anything, so the test asserts the deterministic zero case (events_lost == 0, real_time_buffers_lost == 0). Also exercises query_stats from a separate spawned thread to confirm off-thread access via the Send handle.
  • query_stats_observes_loss_under_blocked_consumer: blocks the ProcessTrace consumer on its first event while a writer floods events into tiny buffers, making loss inevitable. Asserts only hardware-independent invariants: loss is observed (> 0), the counter is non-decreasing across polls, and additional writes drive events_lost strictly higher.

Adds two end-to-end integration tests for query_stats / SessionStats in one_collect/tests/etw_stats_integration.rs: a healthy draining consumer asserting zero loss (and off-thread query access), and a blocked consumer under a write flood asserting loss invariants (observed, non-decreasing, strictly increasing). Both are #[ignore]d since the ETW consumer side requires elevation.

Wires the tests into CI by consolidating the existing TDH integration job and the new stats tests into a single windows-latest job (integration_etw_windows_x64) that runs each binary with --ignored --test-threads=1, elevated as runneradmin.
@utpilla
utpilla force-pushed the utpilla/add-etw-stats-integration-tests branch from 2fdae1d to 08f7c5d Compare July 20, 2026 23:43
@utpilla
utpilla marked this pull request as ready for review July 20, 2026 23:46
@beaubelgrave
beaubelgrave merged commit 2a4f00c into microsoft:main Jul 21, 2026
18 checks passed
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.

2 participants