You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.
When calling getTasklistToken, a handle is left open.
Example:
This test calls getTasklistTokenunder the covers. When running the test locally, Jest gives an error about the handle left open by getTasklistToken:
The above output as text, in case that's useful:
❯ npm run test
> camunda-tasklist-client@0.9.5 test
> jest --detectOpenHandles --runInBand --forceExit
PASS src/__test__/test.spec.ts (14.538 s)
TasklistApiClient
✓ can request all tasks (12021 ms)
Test Suites: 1 passed, 1 total
Tests: 1 passed, 1 total
Snapshots: 0 total
Time: 14.673 s
Ran all test suites.
Jest has detected the following 1 open handle potentially keeping Jest from exiting:
● Timeout
65 |
66 | private async getHeaders() {
> 67 | const token = await getTasklistToken(this.userAgentString);
| ^
68 | return {
69 | 'content-type': 'application/json',
70 | authorization: `Bearer ${token}`,
at OAuthProviderImpl.startExpiryTimer (node_modules/camunda-saas-oauth/dist/lib/OAuthProviderImpl.js:195:28)
at OAuthProviderImpl.fromFileCache (node_modules/camunda-saas-oauth/dist/lib/OAuthProviderImpl.js:160:18)
at OAuthProviderImpl.<anonymous> (node_modules/camunda-saas-oauth/dist/lib/OAuthProviderImpl.js:88:42)
at node_modules/camunda-saas-oauth/dist/lib/OAuthProviderImpl.js:31:71
at Object.<anonymous>.__awaiter (node_modules/camunda-saas-oauth/dist/lib/OAuthProviderImpl.js:27:12)
at OAuthProviderImpl.getToken (node_modules/camunda-saas-oauth/dist/lib/OAuthProviderImpl.js:82:16)
at getTasklistToken (node_modules/camunda-saas-oauth/dist/lib/Tasklist.js:18:34)
Details
As discussed in person with @jwulf, the cause of the open handle is the starting of a timeout so that the token can be evicted from the cache after it expires. To fix this open handle, it might make sense to evict tokens from the cache upon request, if they've exceeded their expiration, instead of using a timer.
The text was updated successfully, but these errors were encountered:
When calling
getTasklistToken
, a handle is left open.Example:
This test calls
getTasklistToken
under the covers. When running the test locally, Jest gives an error about the handle left open bygetTasklistToken
:The above output as text, in case that's useful:
Details
As discussed in person with @jwulf, the cause of the open handle is the starting of a timeout so that the token can be evicted from the cache after it expires. To fix this open handle, it might make sense to evict tokens from the cache upon request, if they've exceeded their expiration, instead of using a timer.
The text was updated successfully, but these errors were encountered: