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

Creating new page in browser context sometimes times out #966

Closed
Tracked by #1138
ankur22 opened this issue Jul 12, 2023 · 2 comments
Closed
Tracked by #1138

Creating new page in browser context sometimes times out #966

ankur22 opened this issue Jul 12, 2023 · 2 comments
Assignees
Labels
bug Something isn't working next Might be eligible for the next planning (not guaranteed!) remote remote browser related
Milestone

Comments

@ankur22
Copy link
Collaborator

ankur22 commented Jul 12, 2023

Brief summary

When running tests against a remote chrome instance(s) we see the following error:

Uncaught (in promise) GoError: creating new page in browser context: timed out after 30s
	at github.com/grafana/xk6-browser/browser.mapBrowserContext.func4 (native)
	at file:///tmp/TgCEDu/script.js:24:15(8)
 executor=shared-iterations scenario=ui

This doesn't occur when running against a locally running chrome instance.

xk6-browser version

a8ebe8c

OS

NA

Chrome version

NA

Docker version and image (if applicable)

NA

Steps to reproduce the problem

When running the following script against a single remote chrome instance:

import { check } from 'k6';
import { browser } from 'k6/experimental/browser';

export const options = {
  scenarios: {
    ui: {
      executor: 'shared-iterations',
      vus: 10,
      iterations: 100,
      options: {
        browser: {
          type: 'chromium',
        },
      },
    },
  },
  thresholds: {
    checks: ["rate==1.0"]
  }
}

export default async function () {
  const context = browser.newContext();
  const page = context.newPage();

  try {
    // Goto front page, find login link and click it
    await page.goto('https://test.k6.io/', { waitUntil: 'networkidle' });
    await Promise.all([
      page.waitForNavigation(),
      page.locator('a[href="/my_messages.php"]').click(),
    ]);
    // Enter login credentials and login
    page.locator('input[name="login"]').type('admin');
    page.locator('input[name="password"]').type('123');
    // We expect the form submission to trigger a navigation, so to prevent a
    // race condition, setup a waiter concurrently while waiting for the click
    // to resolve.
    await Promise.all([
      page.waitForNavigation(),
      page.locator('input[type="submit"]').click(),
    ]);
    check(page, {
      'header': page.locator('h2').textContent() == 'Welcome, admin!',
    });
  } finally {
    page.close();
  }
}

we sometimes see the following error:

Uncaught (in promise) GoError: creating new page in browser context: timed out after 30s
	at github.com/grafana/xk6-browser/browser.mapBrowserContext.func4 (native)
	at file:///tmp/TgCEDu/script.js:24:15(8)
 executor=shared-iterations scenario=ui

This doesn't occur when running against a locally running chrome instance.

Test run id: 154370

Expected behaviour

We don't see those timeouts when a new page is being created.

Actual behaviour

We are seeing creating new page in browser context: timed out after 30s

@ankur22 ankur22 added the bug Something isn't working label Jul 12, 2023
@ankur22 ankur22 added this to the v0.11.0 milestone Jul 12, 2023
@ankur22 ankur22 added the remote remote browser related label Jul 12, 2023
@ankur22 ankur22 changed the title creating new page in browser context: timed out after 30s Creating new page in browser context sometimes times out Jul 12, 2023
@ankur22
Copy link
Collaborator Author

ankur22 commented Jul 24, 2023

Take a look at #970 for the conclusion as to why this is occurring for this particular case.

@ankur22 ankur22 self-assigned this Jul 24, 2023
@inancgumus inancgumus added the next Might be eligible for the next planning (not guaranteed!) label Nov 30, 2023
@inancgumus
Copy link
Member

Closed by #1219.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working next Might be eligible for the next planning (not guaranteed!) remote remote browser related
Projects
None yet
Development

No branches or pull requests

2 participants