Skip to content

Conversation

@joanlopez
Copy link
Contributor

What?

Why?

Checklist

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

Checklist: Documentation (only for k6 maintainers and if relevant)

Please do not merge this PR until the following items are filled out.

  • I have added the correct milestone and labels to the PR.
  • I have updated the release notes: link
  • I have updated or added an issue to the k6-documentation: grafana/k6-docs#NUMBER if applicable
  • I have updated or added an issue to the TypeScript definitions: grafana/k6-DefinitelyTyped#NUMBER if applicable

Related PR(s)/Issue(s)

m.logger.Errorf("NetworkManager", "creating request: %s", err)
return
}
// Skip data and blob URLs, since they're internal to the browser.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course this would break TestURLSkipRequest, as that test is precisely preventing regressions on these lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Arguably this would be a breaking change, so we might need to consider carefully, and perhaps leave it up to k6 v2.0, if we really want to ship it.

Comment on lines +566 to +569
// Skip data and blob URLs, since they're internal to the browser.
if !isInternalURL(req.url) {
m.emitRequestMetrics(req)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

What I don't know, because I lack the historical context from the original PR, is: do we want to skip handling local requests at all, or only to not emit metrics for those requests?

Because with the former, k6 differs from Playwright behavior, in the sense that if a request is supposed to fail, like:
blob:something, for which Chrome (and Playwright) throws net::ERR_FILE_NOT_FOUND at blob:something, k6 doesn't, and the error wouldn't get any error.

While, with the changeset suggested here, the error would be surfaces, as with PW+Chrome, while we would still not emit request metrics for those URLs.

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