Skip to content

Commit 39f6360

Browse files
committed
update unit test variables
1 parent e2f97f5 commit 39f6360

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

incubator/opentelemetry-sampler-aws-xray/test/remote-sampler.test.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('AWSXRayRemoteSampler', () => {
6565
});
6666

6767
it('testCreateRemoteSamplerWithEmptyResource', () => {
68-
const sampler: AWSXRayRemoteSampler = new AWSXRayRemoteSampler({
68+
sampler = new AWSXRayRemoteSampler({
6969
resource: emptyResource(),
7070
});
7171

@@ -361,7 +361,7 @@ describe('AWSXRayRemoteSampler', () => {
361361
.post('/GetSamplingRules')
362362
.reply(200, require(defaultRuleDir));
363363

364-
const sampler: AWSXRayRemoteSampler = new AWSXRayRemoteSampler({
364+
sampler = new AWSXRayRemoteSampler({
365365
resource: emptyResource(),
366366
});
367367
const tracerProvider: NodeTracerProvider = new NodeTracerProvider({
@@ -401,11 +401,13 @@ describe('AWSXRayRemoteSampler', () => {
401401
.post('/GetSamplingRules')
402402
.reply(200, require(defaultRuleDir));
403403

404-
const sampler: _AWSXRayRemoteSampler = new _AWSXRayRemoteSampler({
404+
sampler = new AWSXRayRemoteSampler({
405405
resource: emptyResource(),
406406
});
407+
const internalSampler: _AWSXRayRemoteSampler =
408+
sampler['internalXraySampler'];
407409
const tracerProvider: NodeTracerProvider = new NodeTracerProvider({
408-
sampler: sampler,
410+
sampler: internalSampler,
409411
});
410412
const tracer: Tracer = tracerProvider.getTracer('test');
411413

@@ -421,10 +423,12 @@ describe('AWSXRayRemoteSampler', () => {
421423
// span1 and span2 are child spans of root span0
422424
// For _AWSXRayRemoteSampler (Non-ParentBased), expect all 3 spans to update statistics
423425
expect(
424-
sampler['ruleCache']['ruleAppliers'][0]['statistics'].RequestCount
426+
internalSampler['ruleCache']['ruleAppliers'][0]['statistics']
427+
.RequestCount
425428
).toBe(3);
426429
expect(
427-
sampler['ruleCache']['ruleAppliers'][0]['statistics'].SampleCount
430+
internalSampler['ruleCache']['ruleAppliers'][0]['statistics']
431+
.SampleCount
428432
).toBe(3);
429433
done();
430434
}, 50);

0 commit comments

Comments
 (0)