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

Refactor ClientLoader.clientTests #4548

Merged
merged 6 commits into from
Dec 17, 2024
Merged

Refactor ClientLoader.clientTests #4548

merged 6 commits into from
Dec 17, 2024

Conversation

osipxd
Copy link
Member

@osipxd osipxd commented Dec 12, 2024

Subsystem
Test Infrastructure

Motivation
KTOR-7967 Make client tests independent

Solution
There were several issues with the clientTests function:

  • On JS/WasmJS platform Mocha timeout was applied, so it was impossible to set a bigger timeout for tests individually
  • The configured timeout was applied to the whole test, including different clients and retries. So after the timeout error, there was no sense in retrying,

Refactored client tests to apply timeout to each attempt individually.
The main difficulty of this refactor is JS/WasmJS support. runTest returns TestResult, which is mapped to Promise<Unit> on JS platform, so we can't just retry the test in a loop. For JS we should use Promise.then { ... } and Promise.catch { ... }.

Depends on:

@osipxd osipxd self-assigned this Dec 12, 2024
@osipxd osipxd force-pushed the osipxd/js-tests branch 3 times, most recently from ad6fd0f to 15f4fd5 Compare December 13, 2024 08:52
@osipxd osipxd changed the title Experiments with JS tests Disable mocha timeout Dec 13, 2024
@osipxd osipxd changed the base branch from main to osipxd/nonJvm-source-set December 13, 2024 23:15
@osipxd osipxd force-pushed the osipxd/nonJvm-source-set branch from 91b5826 to 5f3db18 Compare December 16, 2024 11:48
@osipxd osipxd force-pushed the osipxd/js-tests branch 3 times, most recently from b67aba7 to 74eab16 Compare December 16, 2024 11:51
@osipxd osipxd changed the title Disable mocha timeout Refactor ClientLoader.clientTests Dec 16, 2024
@osipxd osipxd force-pushed the osipxd/nonJvm-source-set branch 3 times, most recently from cf7a037 to e7ea6d9 Compare December 17, 2024 13:16
Base automatically changed from osipxd/nonJvm-source-set to main December 17, 2024 14:19
@osipxd osipxd marked this pull request as ready for review December 17, 2024 14:30
@osipxd osipxd requested a review from bjhham December 17, 2024 14:30
Copy link
Contributor

@bjhham bjhham left a comment

Choose a reason for hiding this comment

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

Nice 🥇

@osipxd osipxd enabled auto-merge (squash) December 17, 2024 15:52
@osipxd osipxd merged commit e810eaa into main Dec 17, 2024
16 checks passed
@osipxd osipxd deleted the osipxd/js-tests branch December 17, 2024 16:59
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