Skip to content

Conversation

@pem70
Copy link
Contributor

@pem70 pem70 commented Nov 14, 2025

Issue

Several tests (TestApiResponse, TestOperationGenerator, and OperationMethodAnnotationProcessorTest) were identified as order-dependent (OD) flaky tests. See #5017

Fix

This PR transitions the test class to the JUnit 5 @TestInstance(Lifecycle.PER_CLASS) lifecycle, replacing the shared static field with an instance-scoped variable initialized in @BeforeAll. This resolves order-dependent flakiness by eliminating global state pollution, while ensuring that the resource-intensive Swagger generation runs only once per class. This approach balances test isolation with the performance efficiency required to hopefully prevent resource exhaustion and timeouts in the CI environment.

Checklist

  • Each commit in the pull request should have a meaningful subject line and body.
  • Format the pull request title like [SCB-XXX] Fixes bug in ApproximateQuantiles, where you replace SCB-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install -Pit to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@pem70 pem70 changed the title Fix swagger/swagger-generator/generator-core OD tests [5018] Fix swagger/swagger-generator/generator-core OD tests Nov 14, 2025
@pem70 pem70 changed the title [5018] Fix swagger/swagger-generator/generator-core OD tests [#5017] Fix swagger/swagger-generator/generator-core OD tests Nov 14, 2025
@chengyouling
Copy link
Contributor

rebase to update jdk17 image name

@pem70 pem70 force-pushed the fix-swagger-generator-core-OD-tests branch from 6e4cb30 to b9aa02b Compare November 14, 2025 07:18
@pem70
Copy link
Contributor Author

pem70 commented Nov 14, 2025

rebase to update jdk17 image name

Rebased. Please review

@pem70
Copy link
Contributor Author

pem70 commented Nov 14, 2025

I verified the CI failure and confirmed it comes from the Consul demo test (ConsulIT.clientGetsNoError). This PR only changes test code in the swagger module and does not touch any Consul or runtime components. I ran the failing test locally on the master branch, and it fails there as well. This indicates the CI failure is most likely pre-existing and unrelated to the changes in this PR.
Please let me know how you would like to proceed with this failure.

@pem70 pem70 force-pushed the fix-swagger-generator-core-OD-tests branch 2 times, most recently from bb210ea to ac5e256 Compare November 28, 2025 01:57
@pem70 pem70 marked this pull request as draft November 28, 2025 01:57
@pem70 pem70 force-pushed the fix-swagger-generator-core-OD-tests branch 3 times, most recently from ad7ba6e to bb210ea Compare November 28, 2025 02:00
@pem70 pem70 force-pushed the fix-swagger-generator-core-OD-tests branch from bb210ea to 40356d3 Compare November 28, 2025 02:05
@pem70 pem70 marked this pull request as ready for review November 28, 2025 02:05
@pem70
Copy link
Contributor Author

pem70 commented Nov 28, 2025

Merged newer main branch

@pem70
Copy link
Contributor Author

pem70 commented Dec 3, 2025

Update to generate Swagger operations once per class instead of per method. This will improve performance and hopefully fix the CI error

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