EW-8447 Add regression test for CPU profiling#2558
Merged
harrishancock merged 4 commits intomainfrom Aug 20, 2024
Merged
Conversation
danlapid
reviewed
Aug 20, 2024
Collaborator
There was a problem hiding this comment.
Can you try
npm install -g pnpm@latest-7
pnpm installI believe it should revert most changes to this file :)
Collaborator
Author
There was a problem hiding this comment.
Thanks, that helped.
Collaborator
Author
There was a problem hiding this comment.
Amusingly I had to redo this because #2555 just updated us to pnpm 9.
d842722 to
9a6acf3
Compare
danlapid
reviewed
Aug 20, 2024
danlapid
reviewed
Aug 20, 2024
9a6acf3 to
54212f1
Compare
danlapid
approved these changes
Aug 20, 2024
Collaborator
danlapid
left a comment
There was a problem hiding this comment.
Love it! very concise and clear
In a subsequent commit, I want to make a //src/workerd/server/tests package, which requires this preliminary refactoring.
This commit adds a JavaScript helper library to make workerd subprocess management easier in JavaScript tests. It uses workerd's `--control-fd` feature to fulfill promises once expected ports have come online, similar to how compile-tests/ works. A subsequent commit will depend on this in a new js_test() target.
I needed to update our pnpm-lock.yaml file so I can use chrome-remote-interface in a Bazel js_test() target. Process: - npm install --save-dev chrome-remote-interface - npm install -g pnpm@latest - pnpm install
This commit adds a regression test for the CPU profiling bug reported in #1754 and fixed in #2497. It is based on @mrbbot's original reproduction. I backported the test to the commit just prior to #2497, and confirmed that the test caught the original breakage. I wrote the test in JavaScript, because it seemed to have the richest ecosystem of tools for working with the Chrome Devtool Protocol. I originally intended to use Playwright to initiate a CDP connection to workerd, but it seemed to make too many assumptions that it was connecting to a browser. I tried the [chrome-remote-interface](https://github.com/cyrus-and/chrome-remote-interface) library next, and it seemed to work well. Fixes #1754.
0feda66 to
c6223da
Compare
jasnell
approved these changes
Aug 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a regression test for the CPU profiling bug reported in #1754 and fixed in #2497. It is based on @mrbbot's original reproduction.
I backported the test to the commit just prior to #2497, and confirmed that the test caught the original breakage.
I wrote the test in JavaScript, because it seemed to have the richest ecosystem of tools for working with the Chrome Devtool Protocol. I originally intended to use Playwright to initiate a CDP connection to workerd, but it seemed to make too many assumptions that it was connecting to a browser. I tried the chrome-remote-interface library next, and it seemed to work well.
Fixes #1754.