Skip to content

Commit 31969a3

Browse files
committed
chore: added e2e tests with DynamoDB Table
1 parent 7ec5268 commit 31969a3

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

Diff for: packages/tracing/tests/e2e/tracer.test.ts

+13-11
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ const xray = new AWS.XRay();
2020
const lambdaClient = new AWS.Lambda();
2121
const stsClient = new AWS.STS();
2222

23+
const ONE_MINUTE = 1000 * 60;
24+
2325
describe('Tracer integration tests', () => {
2426

2527
const expectedCustomAnnotationKey = 'myAnnotation';
@@ -123,9 +125,9 @@ describe('Tracer integration tests', () => {
123125
});
124126

125127
// sleep to allow for traces to be collected
126-
await new Promise((resolve) => setTimeout(resolve, 100 * 1000));
128+
await new Promise((resolve) => setTimeout(resolve, ONE_MINUTE * 2));
127129

128-
}, 360000); // 6 minutes
130+
}, ONE_MINUTE * 5);
129131

130132
afterAll(async () => {
131133

@@ -143,7 +145,7 @@ describe('Tracer integration tests', () => {
143145
});
144146
}
145147

146-
}, 180000); // 3 minutes
148+
}, ONE_MINUTE * 2);
147149

148150
it('Verifies that a when Tracer is used to manually instrument a function all custom traces are generated with correct annotations and metadata', async () => {
149151

@@ -213,7 +215,7 @@ describe('Tracer integration tests', () => {
213215
}
214216
}
215217

216-
}, 120000); // 2 minutes
218+
}, ONE_MINUTE * 2);
217219

218220
it('Verifies that a when Tracer is used as middleware all custom traces are generated with correct annotations and metadata', async () => {
219221

@@ -283,7 +285,7 @@ describe('Tracer integration tests', () => {
283285
}
284286
}
285287

286-
}, 120000); // 2 minutes
288+
}, ONE_MINUTE * 2);
287289

288290
it('Verifies that a when Tracer is used as middleware, with errors & response capturing disabled, all custom traces are generated with correct annotations', async () => {
289291

@@ -352,7 +354,7 @@ describe('Tracer integration tests', () => {
352354
}
353355
}
354356

355-
}, 120000); // 2 minutes
357+
}, ONE_MINUTE * 2);
356358

357359
it('Verifies that a when tracing is disabled in middleware mode no custom traces are generated', async () => {
358360

@@ -376,7 +378,7 @@ describe('Tracer integration tests', () => {
376378
}
377379
}
378380

379-
}, 120000); // 2 minutes
381+
}, ONE_MINUTE * 2);
380382

381383
it('Verifies that a when Tracer is used as decorator all custom traces are generated with correct annotations and metadata', async () => {
382384

@@ -473,7 +475,7 @@ describe('Tracer integration tests', () => {
473475
}
474476
}
475477

476-
}, 120000); // 2 minutes
478+
}, ONE_MINUTE * 2);
477479

478480
it('Verifies that a when Tracer is used as decorator on an async handler all custom traces are generated with correct annotations and metadata', async () => {
479481

@@ -570,7 +572,7 @@ describe('Tracer integration tests', () => {
570572
}
571573
}
572574

573-
}, 120000); // 2 minutes
575+
}, ONE_MINUTE * 2);
574576

575577
it('Verifies that a when Tracer is used as decorator, with errors & response capturing disabled, all custom traces are generated with correct annotations', async () => {
576578

@@ -656,7 +658,7 @@ describe('Tracer integration tests', () => {
656658
}
657659
}
658660

659-
}, 120000); // 2 minutes
661+
}, ONE_MINUTE * 2);
660662

661663
it('Verifies that a when tracing is disabled in decorator mode no custom traces are generated', async () => {
662664

@@ -680,6 +682,6 @@ describe('Tracer integration tests', () => {
680682
}
681683
}
682684

683-
}, 120000); // 2 minutes
685+
}, ONE_MINUTE * 2);
684686

685687
});

0 commit comments

Comments
 (0)