apache / apache/servicecomb-java-chassis
[BUG] - multiple order dependent flaky tests in `swagger/swagger-generator/generator-core`
- Dominant language
- Java
- Stars
- 1.9k
- Forks
- 814
- Avg merge
- 8d 23h
- Merged PRs (30d)
- 1
Description
### Steps to Reproduce
Several tests in the `swagger/swagger-generator/generator-core` module exhibit **order-dependent (OD) flakiness**. These tests rely on shared state through `SwaggerOperations.generate(...)` and previously used `static` fields inside the test classes. These tests previously used a `static SwaggerOperations` field that was shared across all test methods in the class, and when test methods are executed in different orders, some permutations caused a later test to run after the shared `swaggerOperations` field had already been cleared.
To reproduce:
```bash
mvn edu.illinois.cs:idflakies-maven-plugin:2.0.0:detect -pl swagger/swagger-generator/generator-core -am -Ddt.randomize.rounds=30 -Ddt.detector.original_order.all_must_pass=false
```
### Expected Behavior
Mentioned tests should pass with different orders.
### Servicecomb Version
3.3.0
### Additional Context
_No response_
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by running the provided idflakies Maven command for swagger/swagger-generator/generator-core and inspect the tests that call SwaggerOperations.generate(...). Trace how the shared swaggerOperations state is initialized and cleared across test methods. Done means the mentioned tests pass across randomized execution orders.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100