Skip to content

Fix flaky page test#5818

Merged
evnchn merged 3 commits intomainfrom
fix-flaky-page-test
Feb 19, 2026
Merged

Fix flaky page test#5818
evnchn merged 3 commits intomainfrom
fix-flaky-page-test

Conversation

@falkoschindler
Copy link
Contributor

Motivation

The test test_warning_if_response_takes_too_long is flaky in CI. When the page's response_timeout fires and the client is deleted, the resulting incomplete page response causes Selenium's get() to hang until its internal script timeout (~30s), throwing a TimeoutException before the test's log assertion is ever reached. This has been observed failing on Python 3.10 and 3.14 in CI (example run).

Implementation

Replace screen.open('/') with a plain httpx.get() request. The test only verifies that a server-side warning is logged — it doesn't need a fully loaded browser page. Using httpx avoids Selenium entirely, eliminating the script timeout issue while keeping the same assertion.

Progress

  • I chose a meaningful title that completes the sentence: "If applied, this PR will..."
  • The implementation is complete.
  • This is not a security issue.
  • Pytests have been updated.
  • Documentation is not necessary.

@falkoschindler falkoschindler added this to the 3.8 milestone Feb 19, 2026
@falkoschindler falkoschindler added testing Type/scope: Pytests and test fixtures review Status: PR is open and needs review labels Feb 19, 2026
@falkoschindler
Copy link
Contributor Author

Let's see if the pipeline agrees with this solution...

evnchn
evnchn previously approved these changes Feb 19, 2026
Copy link
Collaborator

@evnchn evnchn left a comment

Choose a reason for hiding this comment

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

Mergeable as-is, but prefer robustified timings.

Copy link
Collaborator

@evnchn evnchn left a comment

Choose a reason for hiding this comment

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

The commit doesnt show up -> use this instead

Co-authored-by: Evan Chan <37951241+evnchn@users.noreply.github.com>
@evnchn
Copy link
Collaborator

evnchn commented Feb 19, 2026

It should be 1.0 but 1 also works. Anyways I'm eager to close this ASAP (in family dinner btw)

Copy link
Collaborator

@evnchn evnchn left a comment

Choose a reason for hiding this comment

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

tests/test_page.py .......................... [ 55%]

@evnchn evnchn enabled auto-merge February 19, 2026 13:13
@evnchn evnchn added this pull request to the merge queue Feb 19, 2026
Merged via the queue into main with commit f3b8033 Feb 19, 2026
7 checks passed
@evnchn evnchn deleted the fix-flaky-page-test branch February 19, 2026 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review Status: PR is open and needs review testing Type/scope: Pytests and test fixtures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments