Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
fix: Add more debugging info to the system e2e test (#983)
Browse files Browse the repository at this point in the history
* fix: Add more debugging info to the system e2e test

* Fix lint issue

Co-authored-by: James McTavish <mctavish@google.com>
  • Loading branch information
Louis-Ye and mctavish committed Jul 6, 2021
1 parent 1da960a commit 5f670ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 9 additions & 5 deletions system-test/test-e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('@google-cloud/debug end-to-end behavior', () => {
debuggeeId: string;
projectId: string;
}) => {
console.log(c);
console.log('handler received:', c);
if (c.error) {
reject(new Error('A child reported the following error: ' + c.error));
return;
Expand All @@ -91,6 +91,7 @@ describe('@google-cloud/debug end-to-end behavior', () => {
}
numChildrenReady++;
if (numChildrenReady === CLUSTER_WORKERS) {
console.log('All children are ready');
resolve();
}
};
Expand All @@ -105,7 +106,7 @@ describe('@google-cloud/debug end-to-end behavior', () => {
};

for (let i = 0; i < CLUSTER_WORKERS; i++) {
// Fork child processes that sned messages to this process with IPC.
// Fork child processes that send messages to this process with IPC.
// We pass UUID to the children so that they can all get the same
// debuggee id.
const child: Child = {transcript: ''};
Expand All @@ -126,8 +127,8 @@ describe('@google-cloud/debug end-to-end behavior', () => {
afterEach(function () {
this.timeout(5 * 1000);
// Create a promise for each child that resolves when that child exits.
const childExitPromises = children.map(child => {
console.log(child.transcript);
const childExitPromises = children.map((child, index) => {
console.log(`child ${index} transcript: ===#`, child.transcript, '#===');
assert(child.process);
const childProcess = child.process as cp.ChildProcess;
childProcess.kill();
Expand Down Expand Up @@ -164,7 +165,10 @@ describe('@google-cloud/debug end-to-end behavior', () => {
assert.ok(debuggees, 'should get a valid ListDebuggees response');

const result = debuggees.find(d => d.id === debuggeeId);
assert.ok(result, 'should find the debuggee we just registered');
assert.ok(
result,
`should find the debuggee we just registered, expected debuggeeId: ${debuggeeId}, found: ${result}`
);
}

async function verifyDeleteBreakpoints() {
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/fib.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ nocks.metadataInstance();

const UUID = process.argv[2] || uuid.v4();

console.log('UUID: ', UUID);

// eslint-disable-next-line node/no-missing-require
const debuglet = require('../../..').start({
debug: {
Expand Down

0 comments on commit 5f670ee

Please sign in to comment.