Skip to content

Port timeout 0 as no step deadline - #1108

Merged
kblok merged 3 commits into
mainfrom
issue-1093-timeout-zero
Nov 5, 2026
Merged

kblok merged 3 commits into
mainfrom
issue-1093-timeout-zero

Conversation

@kblok

@kblok kblok commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

A Timeout of TimeSpan.Zero used to fail at once on most calls, or be refused. Now it means no deadline of its own, as timeout: 0 does in Playwright: the call waits until the test timeout. This covers locator actions, WaitForAsync, locator and browser matchers, ToHaveScreenshotAsync, Screen.TreeAsync/DebugAsync, Browser.GotoAsync, WaitForResponseAsync, WaitForDownloadAsync(s), and Expect.Poll. A negative timeout is now TestException INVALID_ARGUMENT on all of them.

Upstream parity

Ports e2e-inc/e2e#1554, commit d2953bb.

Ported: the code (Time, LocatorEngine, Screen, Expect, BrowserExpect, ScreenshotCall, Poll, Browser), the tests below, the testbed gap removals (click uses Zero; text-content, route ? glob and select-option single option leave the testbed, listed in their headers; the ExpectedToFailAsync wrappers are gone), docs (migrate/playwright, features/assertions, API reference), SKILL.md, COMPATIBILITY.md.

Partial tests (Partial_): CheckStepTimeoutTests refuse-negative and phase-cap (a TimeSpan cannot be NaN or infinite); LocatorEngineStepDeadlineTests refuse-negative; ExpectPollTests timeout 0 outside an attempt and InsideAnAttemptTests timeout 0 (the poll's phase is the caller's cancellation token; the port has no attempt); BrowserRouteDecisionsTests timeout 0 (real calls, no recording operation).

After #1083 merges, its Should_work_with_no_timeout (now [Ignore]) loses the Ignore: TimeSpan.Zero works now. Known port difference: a bare string in SelectOptionAsync matches the value or the label, where upstream selects by label only on purpose; upstream's test for it is dropped from the testbed. WaitForResponse timeout errors not naming the pattern is tracked in #1068.

Not ported: engine-contract "waits for the test deadline with timeout 0" and the FixtureOperation change (the port has no contributed fixture calls); withTimeout infinite-budget test (no withTimeout); operation(0) test (no operation); upstream's stepTimeout export for engine authors, changeset, testbed README, and the reference pages config/engine/errors/expect/screen/web (the port keeps these in the pages above).

.NET-only symbols: Time.Never, Time.Unbounded (a deadline and a budget that stand for "none", safe from overflow), Time.StepDeadline and Time.StepBudget (upstream's stepTimeout plus Deadline.min, as the port passes engines a TimeSpan), LocatorEngine.AssertionDeadlineFor, Browser.BudgetDeadline and its StepBudget (the browser needs the test deadline), PollExpectation.PollDeadline. Expect.Poll with zero and a token that cannot end throws INVALID_CONFIG (upstream: outside a test).

Closes #1093

🤖 Generated with Claude Code

https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK

A call's Timeout of TimeSpan.Zero now sets no deadline of its own, as timeout: 0 does upstream. A negative timeout is INVALID_ARGUMENT everywhere. Also ports the page wait-for-response tests and drops three by-design Playwright gaps from the testbed tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 22 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

Commits

Reviewing files that changed from the base of the PR and between bb72ae5 and 52d9f13.

Files selected for processing: 32

  • COMPATIBILITY.md
  • docs-site/src/content/docs/api/E2E/ActionOptions.md
  • docs-site/src/content/docs/api/E2E/Browser.md
  • docs-site/src/content/docs/api/E2E/GotoOptions.md
  • docs-site/src/content/docs/api/E2E/LocatorWaitForOptions.md
  • docs-site/src/content/docs/api/E2E/PollOptions.md
  • docs-site/src/content/docs/api/E2E/ScreenshotOptions.md
  • docs-site/src/content/docs/features/assertions.md
  • docs-site/src/content/docs/migrate/playwright.mdx
  • skills/e2e-dotnet/SKILL.md
  • src/E2E/Expect/BrowserExpect.cs
  • src/E2E/Expect/Expect.cs
  • src/E2E/Expect/Poll.cs
  • src/E2E/Expect/ScreenshotAssertion.cs
  • src/E2E/Expect/ScreenshotCall.cs
  • src/E2E/Expect/ScreenshotOptions.cs
  • src/E2E/Internal/Time.cs
  • src/E2E/Locator/LocatorEngine.cs
  • src/E2E/Locator/Screen.cs
  • src/E2E/Run/Browser.cs
  • src/E2E/Run/E2ESession.cs
  • src/E2E/Run/GotoOptions.cs
  • tests/E2E.NUnit.Tests/Click/PageClickTests.cs
  • tests/E2E.NUnit.Tests/LocatorConvenience/LocatorConvenienceTests.cs
  • tests/E2E.NUnit.Tests/Route/PageRouteTests.cs
  • tests/E2E.NUnit.Tests/SelectOption/PageSelectOptionTests.cs
  • tests/E2E.Tests/ExpectPoll/ExpectPollTests.cs
  • tests/E2E.Tests/ExpectPoll/InsideAnAttemptTests.cs
  • tests/E2E.Tests/LocatorEngine/LocatorEngineStepDeadlineTests.cs
  • tests/E2E.Tests/Routes/BrowserRouteDecisionsTests.cs
  • tests/E2E.Tests/ScreenshotAssertions/ToHaveScreenshotTests.cs
  • tests/E2E.Tests/Time/CheckStepTimeoutTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

kblok and others added 2 commits November 5, 2026 11:03
…RL timeout 0

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK
@kblok

kblok commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@kblok
kblok merged commit 0473067 into main Nov 5, 2026
4 checks passed
@kblok
kblok deleted the issue-1093-timeout-zero branch November 5, 2026 14:39
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.

Upstream: timeout 0 means no step deadline (#1554)

1 participant