-
Notifications
You must be signed in to change notification settings - Fork 561
test: make connections.test.ts run faster #3113
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes introduce configurable connection timeout options to test setup utilities and adjust test timing parameters. A new CONNECTION_TIMEOUT constant is added and referenced in error assertions, timeout delays in tests are shortened across multiple locations, and ClientOptions parameter support is added to setup helper functions. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Pull Request Overview
This PR optimizes the connections.test.ts test suite by reducing timeout values, cutting execution time from 24 seconds to 10 seconds. The changes introduce configurable client options through the test setup functions and adjust hardcoded timeouts to shorter durations.
Key Changes:
- Added
ClientOptionsparameter support tosetupClientandsetupMockRippledConnectionfunctions - Reduced connection timeout from default 5000ms to 1000ms for all tests
- Shortened various
setTimeoutcalls from 5000ms/2000ms to 500ms/1500ms
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/xrpl/test/setupClient.ts | Added optional clientOptions parameter to setup functions to allow configuring Client instances with custom options |
| packages/xrpl/test/connection.test.ts | Introduced CONNECTION_TIMEOUT constant set to 1000ms and reduced hardcoded timeouts in tests to make suite run faster |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
High Level Overview of Change
This PR shrinks timeouts to make connections.test.ts run faster. This PR shrinks it from taking 24 seconds to 10.
These changes only appear to be locally, not in CI for some reason, though.
Context of Change
connections.test.tsis by far the longest running test in the test suite.Type of Change
Did you update HISTORY.md?
Test Plan
CI passes.