Skip to content

test(oauth): increase timeouts for file state store checks with multiple entries#2201

Merged
WilliamBergamin merged 1 commit intomainfrom
zimeg-test-oauth-windows-file-store-timeout
Mar 25, 2025
Merged

test(oauth): increase timeouts for file state store checks with multiple entries#2201
WilliamBergamin merged 1 commit intomainfrom
zimeg-test-oauth-windows-file-store-timeout

Conversation

@zimeg
Copy link
Copy Markdown
Member

@zimeg zimeg commented Mar 24, 2025

Summary

This PR hopes to increase the timeout of the FileStateStore "should detect multiple consumption" tests to give time to complete this test without error! For #2159.

Preview

Here's an example error:

https://github.com/slackapi/node-slack-sdk/actions/runs/14045473785/job/39325240536#step:9:119

  1) FileStateStore
       should detect multiple consumption:
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (D:\a\node-slack-sdk\node-slack-sdk\packages\oauth\src\state-stores\file-state-store.spec.ts)

Notes

This loop within tests seems to be causing slowdowns on Windows:

for (let i = 0; i < 200; i++) {
// generate other states
await stateStore.generateStateParam(installUrlOptions, new Date());
}

Passing tests on main tend to be slow for this test so the timeout was increased instead of changing the test logic:

✔ should detect multiple consumption (549ms)  https://github.com/slackapi/node-slack-sdk/actions/runs/14044376455/job/39323919898
✔ should detect multiple consumption (299ms)  https://github.com/slackapi/node-slack-sdk/actions/runs/13958988507/job/39077187942
✔ should detect multiple consumption (696ms)  https://github.com/slackapi/node-slack-sdk/actions/runs/13958988507/job/39077189749
✔ should detect multiple consumption (1227ms) https://github.com/slackapi/node-slack-sdk/actions/runs/13958988507/job/39077191608

Requirements

@zimeg zimeg added tests M-T: Testing work only pkg:oauth applies to `@slack/oauth` labels Mar 24, 2025
@zimeg zimeg self-assigned this Mar 24, 2025
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.69%. Comparing base (0903f5f) to head (11946aa).
Report is 2 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2201   +/-   ##
=======================================
  Coverage   92.69%   92.69%           
=======================================
  Files          38       38           
  Lines       10518    10518           
  Branches      675      675           
=======================================
  Hits         9750     9750           
  Misses        756      756           
  Partials       12       12           
Flag Coverage Δ
cli-hooks 95.23% <ø> (ø)
cli-test 94.76% <ø> (ø)
oauth 77.39% <ø> (ø)
socket-mode 61.82% <ø> (ø)
web-api 98.02% <ø> (ø)
webhook 96.65% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@WilliamBergamin WilliamBergamin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets try this out 💯

@WilliamBergamin WilliamBergamin merged commit 6d68397 into main Mar 25, 2025
57 checks passed
@WilliamBergamin WilliamBergamin deleted the zimeg-test-oauth-windows-file-store-timeout branch March 25, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:oauth applies to `@slack/oauth` tests M-T: Testing work only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants