-
Notifications
You must be signed in to change notification settings - Fork 16
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
INT-3404 - Add tests to validate behavior of jobState.hasKey
#694
Conversation
a976e12
to
06338cf
Compare
The Qualys integration was using `await`ing the result of `jobState.hasKey` and firing off multiple promises with [`pQueue`](https://github.com/sindresorhus/p-queue). The Qualys integration was occasionally seeing `DUPLICATE_KEY_DETECTED` errors being thrown despite checking whether the graph object `_key` exists before adding the new entity to the `jobState`. These tests were added as part of the investigation into the issue. The Qualys integration fix can be found here: JupiterOne-Archives/graph-qualys#190
06338cf
to
ec315eb
Compare
The Qualys integration was using `await`ing the result of `jobState.hasKey` and firing off multiple promises with [`pQueue`](https://github.com/sindresorhus/p-queue). The Qualys integration was occasionally seeing `DUPLICATE_KEY_DETECTED` errors being thrown despite checking whether the graph object `_key` exists before adding the new entity to the `jobState`. These tests were added as part of the investigation into the issue. The Qualys integration fix can be found here: JupiterOne-Archives/graph-qualys#190
ec315eb
to
2fea84f
Compare
packages/integration-sdk-runtime/src/execution/__tests__/jobState.test.ts
Outdated
Show resolved
Hide resolved
// the `hasKey` promise while handling multiple entities concurrently, | ||
// could result in a `hasKey` returning `false` because neither of the | ||
// duplicate entities have been fully added to the job state yet. | ||
if (jobState.hasKey(e._key)) return; |
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.
It seems to me that the documentation here
hasKey: (_key: string | undefined) => boolean | Promise<boolean>; |
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.
Agreed. Can tackle separately. Will open ticket. Thanks for suggestion.
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.
The Qualys integration was using
await
ing the result ofjobState.hasKey
and firing off multiple promises with
pQueue
.The Qualys integration was occasionally seeing
DUPLICATE_KEY_DETECTED
errors being thrown despite checking whether the graph object
_key
exists before adding the new entity to the
jobState
. These tests wereadded as part of the investigation into the issue.
The Qualys integration fix can be found here: JupiterOne-Archives/graph-qualys#190