-
Notifications
You must be signed in to change notification settings - Fork 39
test: corrected and clarified bull test cases #2002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ if (process.env.INSTANA_DEBUG === 'true') { | |
|
|
||
| // NOTE: we can leave the hardcoded port here as this file is not used in the test env! | ||
| const port = process.env.AGENT_PORT || 42699; | ||
| const uniqueAgentUuids = process.env.AGENT_UNIQUE_UUIDS === 'true'; | ||
| const extraHeaders = process.env.EXTRA_HEADERS ? process.env.EXTRA_HEADERS.split(',') : []; | ||
| const secretsMatcher = process.env.SECRETS_MATCHER ? process.env.SECRETS_MATCHER : 'contains-ignore-case'; | ||
| const secretsList = process.env.SECRETS_LIST ? process.env.SECRETS_LIST.split(',') : ['pass', 'secret', 'token']; | ||
|
|
@@ -44,6 +45,7 @@ const kafkaTraceCorrelation = process.env.KAFKA_TRACE_CORRELATION | |
| const ignoreEndpoints = process.env.IGNORE_ENDPOINTS && JSON.parse(process.env.IGNORE_ENDPOINTS); | ||
| const disable = process.env.AGENT_DISABLE_TRACING && JSON.parse(process.env.AGENT_DISABLE_TRACING); | ||
|
|
||
| const uuids = {}; | ||
| let discoveries = {}; | ||
| let rejectAnnounceAttempts = 0; | ||
| let requests = {}; | ||
|
|
@@ -81,8 +83,16 @@ app.put('/com.instana.plugin.nodejs.discovery', (req, res) => { | |
| } | ||
| logger.debug('New discovery %s with params', pid, req.body); | ||
|
|
||
| let uuid; | ||
|
|
||
| if (uniqueAgentUuids) { | ||
| uuid = uuids[pid] = `agent-stub-uuid-${pid}`; | ||
| } else { | ||
| uuid = 'agent-stub-uuid'; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The bull tests were false positives. The test asserted that the spans from the bull child process (bull forks a process for jobs), have this uuid for Each process gets now its own uuid. |
||
| } | ||
|
|
||
| const response = { | ||
| agentUuid: 'agent-stub-uuid', | ||
| agentUuid: uuid, | ||
| pid, | ||
| extraHeaders, | ||
| secrets: { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you comment out this line, the tests still work.
The corrected test logic proofs that this is not used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another PR will come to remove it and to improve the logic in our codebase for this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was refactoring the codebase for util, config and logging and these agentOpts file was in my way and then I digged into this, because its very dirty code.