Skip to content

Flaky CI Failure: browser-sdk DebugInformation 'should return network API statistics' — expected 0n but got 1n #3827

Description

@github-actions

Flaky CI Failure: browser-sdk DebugInformation 'should return network API statistics' — expected 0n but got 1n

Workflow: Test
Failed run: https://github.com/xmtp/libxmtp/actions/runs/28830970802
Commit: e181466
Failed jobs: test-browser-sdk / Test (browser-sdk) shard 1

Summary

The browser-sdk integration test DebugInformation > should return network API statistics in test/DebugInformation.test.ts failed in the Chromium environment. The assertion at line 42 expected apiIdentityStats2.getIdentityUpdatesV2 to be 0n (bigint zero) after a stats reset, but received 1n. All 196 other passing tests ran fine; only this single assertion failed.

Error Details

 FAIL  chromium  test/DebugInformation.test.ts > DebugInformation > should return network API statistics
AssertionError: expected 1n to be 0n // Object.is equality

- Expected
+ Received

- 0n
+ 1n

 ❯ test/DebugInformation.test.ts:42:51
  40|     const apiIdentityStats2 =
  41|       await client.debugInformation.apiIdentityStatistics();
  42|     expect(apiIdentityStats2.getIdentityUpdatesV2).toBe(0n);
     |                                                   ^
  43|     expect(apiIdentityStats2.getInboxIds).toBe(0n);
  44|     expect(apiIdentityStats2.publishIdentityUpdate).toBe(0n);

 Test Files  1 failed | 13 passed | 1 skipped (15)
       Tests  1 failed | 196 passed | 12 skipped (209)
   Duration  32.60s

##[error]AssertionError: expected 1n to be 0n // Object.is equality
error: recipe `test-browser-sdk-ci` failed on line 41 with exit code 1

Analysis

The test verifies that API identity statistics counters are zero after being reset (second snapshot at apiIdentityStats2). The getIdentityUpdatesV2 counter shows 1n instead of the expected 0n, indicating an extra getIdentityUpdates call was made between the reset and the assertion. This is consistent with a race condition where background activity (e.g., an async sync task, a worker, or cross-test state) triggers an additional identity update fetch that increments the counter before it can be asserted as zero.

This is a test/code failure (not an infrastructure issue). The browser WASM environment is healthy — all other 196 tests passed. A similar off-by-one issue was previously observed for Android in #3698 (testNetworkDebugInformation — expected:<3> but was:<4>), suggesting the underlying API stats counters are sensitive to non-deterministic background network activity across platforms.


Reported by Flaky Failure Watcher

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions