Skip to content

test: Investigate integration test timeout #2487

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

Closed
wants to merge 7 commits into from

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Mar 8, 2025

Pull Request

Issue

Trying to narrow down what's causing the following issue. I can't replicate it locally so this is guess work. Everytime this issue happens it when on a test that calls reconfigureServer. There are currently 31 test that uses this function. I believe it's stalling in either ParseServer.handleShutdown or ParseServer.server.close. I would assume close would be added into shutdown but it isn't. There might be something stalling in shutdown too i.e LiveQueryServer.

Another place to look is the afterEach in helper.js as there might be a stall there with deleting all records from the database or logging out user.

There is a test case on the Server that if fixed would give a clue on how to solve this issue. Unfortunately it's being skipped.

https://github.com/parse-community/parse-server/blob/4f55c3e9cfa31c6aca9c005ab21ff6193600ba89/spec/ParseServer.spec.js#L47-L49

Error: Timeout - Async function did not complete within 20000ms (set by jasmine.DEFAULT_TIMEOUT_INTERVAL)

https://github.com/parse-community/Parse-SDK-JS/actions/runs/13735695802/job/38419094737?pr=2486

Approach

  • Remove unused route
  • Cache distribution files for performance
  • Remove potentally stalled functions
  • Improve shutdown tests
  • Set REQUEST_ATTEMPT_LIMIT to 1 to check for network drops
  • Add try / catch to afterEach in helper.js to check for stalling
  • Use jasmine default timeout (5000ms) to check if startup time is an issue.

Might have to re-run the CI a few times to see if this issue replicates

Tasks

  • Add tests
  • Add changes to documentation (guides, repository pages, code comments)

Copy link

parse-github-assistant bot commented Mar 8, 2025

Thanks for opening this pull request!

  • ❌ Please link an issue that describes the reason for this pull request, otherwise your pull request will be closed. Make sure to write it as Closes: #123 in the PR description, so I can recognize it.

Copy link

codecov bot commented Mar 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (539ba2a) to head (6fe81ad).

Additional details and impacted files
@@            Coverage Diff            @@
##             alpha     #2487   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           64        64           
  Lines         6256      6256           
  Branches      1474      1447   -27     
=========================================
  Hits          6256      6256           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dplewis
Copy link
Member Author

dplewis commented Mar 8, 2025

After further investigation parseServer.handleShutdown calls liveQueryServer.server.close(). When initializing the server with startLiveQueryServer option liveQueryServer.server and parseServer.server are the same so we are calling server.close() twice. This maybe the cause of the issue. As we can see the tests still pass without getting an EADDRINUSE error because now we are calling close once.

@dplewis dplewis requested a review from a team March 8, 2025 16:02
@dplewis dplewis closed this Mar 8, 2025
@mtrezza
Copy link
Member

mtrezza commented Mar 8, 2025

This has been closed?

@dplewis
Copy link
Member Author

dplewis commented Mar 9, 2025

I closed it because I'm still working on it. Didn't want to keep pinging the community with dozen of commits

@mtrezza
Copy link
Member

mtrezza commented Mar 9, 2025

Got it, I think you could also put a PR in draft state, so visitors will know that it doesn't require any action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants