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

Abort the iteration on panic even if caught #816

Open
inancgumus opened this issue Mar 7, 2023 · 1 comment
Open

Abort the iteration on panic even if caught #816

inancgumus opened this issue Mar 7, 2023 · 1 comment
Labels
bug Something isn't working evaluate ux

Comments

@inancgumus
Copy link
Member

inancgumus commented Mar 7, 2023

The following script should panic, end the iteration, and kill the browser.

The problem is, it panics and kills the browser, however, the test carries on until eventually times out.

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

export default async function() {
  const browser = chromium.launch({ headless: true });
  const context = browser.newContext();

  try {
    context.cookies();
    console.log("should not reach here");
  } catch (e) {
    console.log('check panicked: ' + e)
  } finally {
    browser.close();
  }
}

It seems the code stuck here (browser.close();) while sending the CDP browser close message since k6ext.Panic killed the browser.

Related: #815

@inancgumus inancgumus added bug Something isn't working ux labels Mar 7, 2023
@inancgumus inancgumus added this to the v0.9.0 milestone Mar 7, 2023
@inancgumus inancgumus self-assigned this Mar 7, 2023
@inancgumus inancgumus changed the title Abort the iteration on panic even if it's being catched Abort the iteration on panic even if caught Mar 7, 2023
@inancgumus inancgumus removed their assignment Mar 31, 2023
@inancgumus inancgumus removed this from the v0.9.0 milestone Mar 31, 2023
@inancgumus
Copy link
Member Author

I can't reproduce this anymore. Also, Pids() interface check seems to be stopped working when a panic occurs. For instance, context.exposeBinding() panics, but Panic misses the Pids() method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working evaluate ux
Projects
None yet
Development

No branches or pull requests

1 participant