Skip to content

Commit

Permalink
Merge pull request #2699 from cloudflare/harris/becalm-inspector-test
Browse files Browse the repository at this point in the history
Reduce number of iterations in inspector-test
  • Loading branch information
harrishancock authored Sep 12, 2024
2 parents e2d40ae + b5c7e9d commit d1bd777
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions src/workerd/server/tests/inspector/driver.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -99,22 +99,15 @@ async function profileAndExpectDeriveBitsFrames(inspectorClient) {
assert.notEqual(max.count, 0);
}

// Regression test for https://github.com/cloudflare/workerd/issues/1754.
// Regression test for:
// - https://github.com/cloudflare/workerd/issues/1754
// - https://github.com/cloudflare/workerd/issues/2564
//
// At one time, workerd produced only "(program)" frames.
test('Profiler mostly sees deriveBits() frames', async () => {
let inspectorClient = await connectInspector(
await workerd.getListenInspectorPort()
);
await profileAndExpectDeriveBitsFrames(inspectorClient);
await inspectorClient.close();
});

// Regression test for https://github.com/cloudflare/workerd/issues/2564.
//
// At one time, workerd segfaulted on the second inspector connection.
test('Can repeatedly reconnect the inspector and profiling still works', async () => {
for (let i = 0; i < 4; ++i) {
// At one time, workerd profiling broke, and started producing only "(program)" frames. My original
// attempt at a fix subsequently caused workerd to segfault on the second inspector connection. This
// rather expensive test case exercises both regressions.
test('Profiler mostly sees deriveBits() frames, and can safely reconnect', async () => {
for (let i = 0; i < 2; ++i) {
let inspectorClient = await connectInspector(
await workerd.getListenInspectorPort()
);
Expand Down

0 comments on commit d1bd777

Please sign in to comment.