Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🥅 Make Watcher not throw an exception if network idle times out #25

Merged
merged 2 commits into from
Oct 20, 2023

Conversation

jwir3
Copy link
Contributor

@jwir3 jwir3 commented Oct 19, 2023

Fixes AP-3761.

Issue: AP-3761

What Changed

Previous to this, Watcher would throw an exception if the global network idle timer timed out. This changes it to not throw an error, and instead log the error and move on. It also adjusts the default timeout to be configurable, defaulting to 10s.

How to test

Follow the reproduction steps in AP-3761.

Change Type

  • maintenance
  • documentation
  • patch
  • minor
  • major
📦 Published PR as canary version: 0.0.29--canary.25.4e99d70.0

✨ Test out this PR locally via:

npm install @chromaui/test-archiver@0.0.29--canary.25.4e99d70.0
# or 
yarn add @chromaui/test-archiver@0.0.29--canary.25.4e99d70.0

@jwir3 jwir3 requested a review from thafryer October 19, 2023 18:52
@linear
Copy link

linear bot commented Oct 19, 2023

AP-3761 CDP failures are causing tests to fail

What

A customer sees tests failing when using chromaui/test-archiver that aren't failing when only using playwright-test.

test-archiver is timing out after a specified interval (2000 ms currently), and some of the resources (.woff font files) are taking longer than that to load, so we're throwing an error, which fails the spec.

Reproducing the error

I can reproduce by putting the following spec into a typical Playwright project, then running npx playwright test:

test('has title', async ({ page }, testInfo) => {
  await page.goto('https://www.getty.edu/art/collection/search?images=true&q=sculpture');

  // Expect a title "to contain" a substring.
  await expect(page).toHaveTitle(/Search for keyword: 'sculpture', with Images \(Getty Museum\)/);
});

Possible solutions

I don't experience the problem if I increase the network timeout (anything above 5000 ms). Not sure if there's a reason it is currently at 2000 ms, though (perhaps that makes the tests finish more quickly if all is well).

@jwir3 jwir3 force-pushed the jwir3/AP-3761-network-watcher-no-throw branch from dcbc99a to 20a920c Compare October 19, 2023 18:56
Copy link
Member

@thafryer thafryer left a comment

Choose a reason for hiding this comment

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

LGTM. This looks great. I suggest making it more explicit that this is a resourceArchive timeout, not a timeout for all network calls made in general.

package-lock.json Outdated Show resolved Hide resolved
src/playwright-api/makeTest.ts Outdated Show resolved Hide resolved
jwir3 and others added 2 commits October 20, 2023 09:42
Co-authored-by: Jarel Fryer <68470411+thafryer@users.noreply.github.com>
@jwir3 jwir3 force-pushed the jwir3/AP-3761-network-watcher-no-throw branch from eff3239 to 4e99d70 Compare October 20, 2023 14:43
@jwir3 jwir3 merged commit 238024d into main Oct 20, 2023
2 checks passed
@thafryer
Copy link
Member

🚀 PR was released in v0.0.29 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants