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

Deadlock in the cloud #496

Closed
sniku opened this issue Aug 12, 2022 · 2 comments
Closed

Deadlock in the cloud #496

sniku opened this issue Aug 12, 2022 · 2 comments
Assignees
Labels
bug Something isn't working next Might be eligible for the next planning (not guaranteed!)
Milestone

Comments

@sniku
Copy link
Collaborator

sniku commented Aug 12, 2022

The browser test seems to dead-lock after 3-10min.
This is likely not related to the cloud, but it's easiest to spot it there because the metrics stop being generated while k6 continues to run.

  • CPU drops to near 0%.
  • The memory stays constant. (which probably means that the chromium process is running)
  • no iterations are being executed
  • no browser metrics are being collected

Sample script:

import { check } from 'k6';
import { chromium } from 'k6/x/browser';

export let options = {
  vus: 1,
  duration: '50m'
}

export default function () {
  const browser = chromium.launch('chromium', {
    headless: true,
  });
  const context = browser.newContext();
  const page = context.newPage();

  // Goto front page, find login link and click it
  page.goto('https://test.k6.io/', { waitUntil: 'networkidle' });
  const elem = page.$('a[href="/my_messages.php"]');
  elem.click().then(() => {
    // Enter login credentials and login
    page.$('input[name="login"]').type('admin');
    page.$('input[name="password"]').type('123');
    return page.$('input[type="submit"]').click();
  }).then(() => {
    // We expect the above form submission to trigger navigation, so wait for it
    // and the page to be loaded.
    page.waitForNavigation();

    check(page, {
      'header': page.$('h2').textContent() == 'Welcome, admin!',
    });
  }).finally(() => {
    page.close();
    browser.close();
  });
}

image (7)
image

@sniku sniku added the bug Something isn't working label Aug 12, 2022
@imiric imiric added next Might be eligible for the next planning (not guaranteed!) cloud labels Aug 12, 2022
@ankur22 ankur22 added this to the v0.5.0 milestone Aug 18, 2022
@ankur22
Copy link
Collaborator

ankur22 commented Aug 18, 2022

We think the deadlock issue in the cloud (#496) is the same as issue as the test timeout issue in waitForExecutionContext (#482).

deadlock-cloud-stacktrace.txt

The fix and further details will be raised in #482, unless we find something else.

@ankur22
Copy link
Collaborator

ankur22 commented Oct 7, 2022

We believe that this has been resolved (for now) with PR #555 (issue #553, which was created due to the deadlock issue). We have ran several tests locally and int he cloud and it hasn't resurfaced yet. There's a chance that this could still occur though (obviously in case we missed anything) if the CDP events are sent out of order by the browser.

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!)
Projects
None yet
Development

No branches or pull requests

4 participants