Skip to content
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

⚡️ Improve multiple timeout tests #2142

Merged
merged 5 commits into from
Mar 18, 2024

Conversation

AlexV525
Copy link
Member

@AlexV525 AlexV525 commented Mar 15, 2024

  • Further try ✅ Fix download stream tests #2140, using drip to control the overall response duration.
  • Make cancellation calls only after the response stream has been obtained to keep the call sequence.
  • Using the non-routable URL (10.0.0.0) to mock connection timeouts.

New Pull Request Checklist

  • I have read the Documentation
  • I have searched for a similar pull request in the project and found none
  • I have updated this branch with the latest main branch to avoid conflicts (via merge from master or rebase)
  • I have added the required tests to prove the fix/feature I'm adding
  • I have updated the documentation (if necessary)
  • I have run the tests without failures
  • I have updated the CHANGELOG.md in the corresponding package

@kuhnroyal
Copy link
Member

Using drip is actually a great idea, didn't think of that!

@AlexV525 AlexV525 changed the title ⚡️ Use drip for download cancel tests ⚡️ Improve multiple timeout tests Mar 15, 2024
@AlexV525 AlexV525 marked this pull request as ready for review March 15, 2024 16:53
@AlexV525 AlexV525 requested a review from a team as a code owner March 15, 2024 16:53
@AlexV525
Copy link
Member Author

I've updated the description, this might significantly help with random test failures.

@AlexV525 AlexV525 enabled auto-merge March 15, 2024 16:56
Copy link
Member

@kuhnroyal kuhnroyal left a comment

Choose a reason for hiding this comment

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

Wonder if we should test the connection timeouts with mocks?

dio_test/lib/src/test/timeout_tests.dart Show resolved Hide resolved
dio_test/lib/src/test/timeout_tests.dart Show resolved Hide resolved
@AlexV525
Copy link
Member Author

Wonder if we should test the connection timeouts with mocks?

Okay so it's not a mock, it happens because the IP is non-reachable in a regular LAN network. We should use the same URL (or something like 192.168.0.0) if we want to make sure that the connection timeouts statically happened.
Regarding the name of tests, they might also changed to non-response-related.

@AlexV525 AlexV525 added this pull request to the merge queue Mar 18, 2024
Merged via the queue into main with commit 797145a Mar 18, 2024
3 checks passed
@AlexV525 AlexV525 deleted the fix/download-stream-tests-use-drip branch March 18, 2024 17:22
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