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

WIP: Add abort event #3929

Closed
wants to merge 5 commits into from
Closed

WIP: Add abort event #3929

wants to merge 5 commits into from

Conversation

ankur22
Copy link
Contributor

@ankur22 ankur22 commented Sep 3, 2024

What?

Adds a temporary Abort event which would signal to subscribers that k6 has received a termination signal from somewhere (REST, OS, etc).

Why?

The browser module currently isn't relying on the VU Context to control the iteration lifecycle. There is an open issue to move it over to working with the VU Context. A quick fix is to add an Abort event which will inform the browser module to close any chromium instances down, which will force any waiting API calls to exit since the connection to chromium has ended.

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (make lint) and all checks pass.
  • I have run tests locally (make tests) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Related PR(s)/Issue(s)

Updates: https:/grafana/k6-cloud/issues/2664

This event will be emitted when gracefulStop is called. It's a
temporary solution to avoid issues when SIGTERMs are handled by k6, but
not by downstream modules such as the browser module.
This is a temporary solution to a problem the browser module is facing
when a signal (e.g. SIGTERM) is handled by k6, but is not correctly
handled by the browser module. The reason is due to it not working with
the vu context. More details in the open issue:
grafana/xk6-browser#1410.

The introduction of a temporary abort event will be fired, which the
browser module can intercept and action on immediately.
@ankur22 ankur22 requested a review from a team as a code owner September 3, 2024 15:54
@ankur22 ankur22 requested review from olegbespalov and joanlopez and removed request for a team September 3, 2024 15:54
@ankur22 ankur22 marked this pull request as draft September 3, 2024 15:54
@ankur22
Copy link
Contributor Author

ankur22 commented Sep 13, 2024

Closing as we found a working solution: grafana/xk6-browser#1420

@ankur22 ankur22 closed this Sep 13, 2024
@ankur22 ankur22 deleted the add/abort-event branch September 13, 2024 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant