Skip to content

Commit 10da4db

Browse files
authored
test(auto-instrumentations-node): fix spurious test timeout from variable runtime of cloud resource detectors (#2815)
1 parent a99ba69 commit 10da4db

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

metapackages/auto-instrumentations-node/test/register.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ function runWithRegister(path: string): PromiseWithChild<{
3939
// node v18.17.0, v20.3.0 and later results in ANSI color escapes
4040
// in the ConsoleSpanExporter output that is checked below.
4141
FORCE_COLOR: '0',
42+
// Cloud resource detectors can take a few seconds, resulting in hitting
43+
// a test timeout.
44+
OTEL_NODE_RESOURCE_DETECTORS: 'none',
4245
}),
4346
}
4447
);
@@ -60,6 +63,8 @@ function waitForString(stream: Readable, str: string): Promise<void> {
6063
}
6164

6265
describe('Register', function () {
66+
this.timeout(5000); // Same timeout as in the execFile() above.
67+
6368
it('can load auto instrumentation from command line', async () => {
6469
const runPromise = runWithRegister('./test-app/app.js');
6570
const { child } = runPromise;

0 commit comments

Comments
 (0)