Skip to content

test(NODE-7831): widen duration bounds in flaky timing assertions - #5050

Open
tadjik1 wants to merge 1 commit into
mainfrom
NODE-7831
Open

tadjik1 wants to merge 1 commit into
mainfrom
NODE-7831

Conversation

@tadjik1

@tadjik1 tadjik1 commented Sep 11, 2026

Copy link
Copy Markdown
Member

Description

Adds small timing tolerances to two flaky duration assertions (sleep timers run on a millisecond-granularity clock and can complete marginally early when measured with performance.now()).

Double check the following

  • Lint is passing (npm run check:lint)
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@tadjik1 tadjik1 added the Blocked Blocked on other work label Sep 11, 2026
@tadjik1
tadjik1 marked this pull request as ready for review September 14, 2026 11:19
@tadjik1
tadjik1 requested a review from a team as a code owner September 14, 2026 11:19
Copilot AI lite review requested due to automatic review settings September 14, 2026 11:19
@tadjik1 tadjik1 removed the Blocked Blocked on other work label Sep 14, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The remaining documentation nit is non-blocking.

Pull request overview

Widen timing assertion tolerances in CSFLE and client backpressure integration tests to reduce flaky failures.

Changes:

  • Lower the CSOT timeout bound from 498ms to 495ms.
  • Add 5ms tolerance to backoff duration assertions.
  • Document timing precision rationale.
File summaries
File Description
test/integration/client-side-encryption/driver.test.ts Relaxes CSOT timeout timing bounds.
test/integration/client-backpressure/client-backpressure.prose.test.ts Adds tolerance for backoff timing measurements.
Review details

Suppressed comments (1)

test/integration/client-backpressure/client-backpressure.prose.test.ts:220

  • This explanation says the duration is measured with a higher-resolution clock, but measureDuration calls processTimeMS(), which floors performance.now() to whole milliseconds (test/tools/utils.ts:535-539, src/utils.ts:441-443). Please describe the actual millisecond-truncated measurement so the rationale for this tolerance is not misleading.
      //     are `0.1 + 0.2 = 0.3s`. The lower bounds include a small tolerance because sleep
      //     timers run on a millisecond-granularity clock, so a sleep can complete marginally
      //     earlier than the requested duration when measured with a higher-resolution clock.
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@tadjik1 tadjik1 changed the title [WIP] test(NODE-7831): widen duration bounds in flaky timing assertions test(NODE-7831): widen duration bounds in flaky timing assertions Sep 14, 2026
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