sergehuber opened a new pull request, #780: URL: https://github.com/apache/unomi/pull/780
## Summary for non-technical readers This change fixes two things that were making our automated tests unreliable on busy build servers, and fixes a documentation build error that was breaking our nightly publish job. - **Flaky tests:** some automated tests were timing out on slower/busier test machines even though nothing was actually broken — they just needed a bit more patience. We gave them more time and more retry attempts. - **A real bug we found while fixing the above:** when the scheduler shuts down, it's supposed to mark any in-progress task as "crashed" so it can be safely restarted later. We discovered this safety mechanism was silently failing to actually save its work, which could leave the system in an inconsistent state after a restart. This is now fixed and covered by new automated tests. - **Broken documentation builds:** 24 files in one part of the codebase had malformed comments that broke our documentation generator. These are now cleaned up, and we added a `--javadoc` option to our build script so developers can catch this kind of error on their own machine before pushing, instead of finding out from a failed CI job. ## Linked ticket [UNOMI-955](https://issues.apache.org/jira/browse/UNOMI-955) — Fix recurring CI failures and add local Javadoc validation to build script Ticket scope: 1. Flaky tests due to timeouts calibrated for fast local environments rather than busy CI machines (scheduler and GraphQL test suites). 2. Cascading test failures: when the scheduler service stops, it leaves tasks in a RUNNING state, corrupting shared storage and breaking subsequent tests (`ProfileServiceImplTest`, `SegmentServiceImplTest`, `RulesServiceImplTest`). 3. Javadoc build errors: 24 files in the router extension contain stray `</p>` closing tags in their Javadoc comments, breaking the nightly Javadoc publish job. 4. No local validation: the build script lacked a Javadoc validation option, so developers couldn't catch doclint errors before pushing. ## What changed - Rewrote Javadoc across `api`, `services-common`, `persistence-spi`, and the router extensions so `mvn javadoc:javadoc` runs clean (no doclint errors), removing the malformed `</p>` tags called out in the ticket. - Added a `--javadoc` flag to `build.sh` (also implied by `--ci`) that runs `javadoc:javadoc` and fails the build on doclint errors, so this class of failure is now catchable locally. - Fixed a real bug found during review: `SchedulerServiceImpl`'s shutdown sequence was meant to mark any task still `RUNNING` as `CRASHED` so it can be safely rescheduled, but it queried/saved tasks through wrapper methods (`getAllTasks()` / `saveTask()`) that silently no-op once the shutdown flag is set — so the crash-marking never actually persisted. Reworked it to go through the persistence provider directly. - Added two new unit tests in `SchedulerServiceImplTest` that reproduce the bug against the old code (both fail with `expected: <CRASHED> but was: <RUNNING>`) and pass against the fix. - Increased `SchedulerServiceImplTest.TEST_TIMEOUT` from 5s to 15s, and replaced a hardcoded retry count of `30` in `GraphQLListIT` with `DEFAULT_TRYING_TRIES * 3`, to give both suites more margin on loaded CI runners. ## Test plan - [x] `mvn javadoc:javadoc -DskipTests` on `api`, `services`, `services-common`, `persistence-spi`, `extensions/router/router-api`, `extensions/router/router-core` — no doclint errors - [x] `mvn -pl services test -Dtest=SchedulerServiceImplTest` — 33/33 passing, including the two new regression tests - [x] Verified the two new tests fail against the pre-fix code (confirms they actually catch the bug) and pass against the fix - [x] `mvn -pl itests -P integration-tests test-compile` — `GraphQLListIT` change compiles -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
