Skip to content

Commit

Permalink
fix flaky user_tracking test (#5172)
Browse files Browse the repository at this point in the history
  • Loading branch information
simon-id authored Jan 30, 2025
1 parent ff05e3b commit f3bb2a7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/dd-trace/test/appsec/user_tracking.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

const assert = require('assert')

const log = require('../../src/log')
const telemetry = require('../../src/appsec/telemetry')
const { SAMPLING_MECHANISM_APPSEC } = require('../../src/constants')
const standalone = require('../../src/appsec/standalone')
Expand All @@ -11,14 +10,13 @@ const waf = require('../../src/appsec/waf')
describe('User Tracking', () => {
let currentTags
let rootSpan
let log
let keepTrace

let setCollectionMode
let trackLogin

beforeEach(() => {
sinon.stub(log, 'warn')
sinon.stub(log, 'error')
sinon.stub(telemetry, 'incrementMissingUserLoginMetric')
sinon.stub(standalone, 'sample')
sinon.stub(waf, 'run').returns(['action1'])
Expand All @@ -30,9 +28,15 @@ describe('User Tracking', () => {
addTags: sinon.stub()
}

log = {
warn: sinon.stub(),
error: sinon.stub()
}

keepTrace = sinon.stub()

const UserTracking = proxyquire('../src/appsec/user_tracking', {
'../log': log,
'../priority_sampler': { keepTrace }
})

Expand Down

0 comments on commit f3bb2a7

Please sign in to comment.