Skip to content

[itests] Fix flaky LogTest - #3006

Merged
jbonofre merged 1 commit into
apache:mainfrom
jbonofre:fix-flaky-logtest
Oct 16, 2026
Merged

jbonofre merged 1 commit into
apache:mainfrom
jbonofre:fix-flaky-logtest

Conversation

@jbonofre

Copy link
Copy Markdown
Member

Problem

LogTest fails randomly with IllegalStateException: Unrecognized configuration (e.g. in the CI run of #2999, setGetDebugAndClear and setGetDebugAndClearAlias).

log:set ends with cfg.update(), which ConfigAdmin and pax-logging apply asynchronously. assertSetLevel ran log:get right after log:set, so it could read the logging configuration while pax-logging was reconfiguring, or still see the previous level. The Thread.sleep(100) was at the end of the helper, too late to help, and the test retry rule hit the same failure again.

Also, log:list and ld are aliases defined in shell.init.script, not command services. executeAlias waited the full 30 seconds (ALIAS_SERVICE_TIMEOUT) for a service that is never registered, on every call. The class took about 127 seconds in that CI run, which also widened the race window.

Changes

  • assertSetLevel polls log:get and log:list (up to 30 seconds) until the new level is visible, treating the transient exception as "not applied yet".
  • Alias calls (log:list, ld) no longer wait for a command service.

Only LogTest is changed; LogServiceImpl is untouched.

Testing

itests/test compiles. I did not run LogTest locally.

log:set updates the pax-logging configuration asynchronously, so reading it right after can fail with 'Unrecognized configuration' or return the previous level. Wait for the new level to be applied instead of failing right away.

log:list and ld are aliases, not command services: don't wait 30 seconds for a service that is never registered on each call.
@github-actions

Copy link
Copy Markdown

Test Results

  729 files  ±0    729 suites  ±0   1h 7m 55s ⏱️ - 13m 5s
1 077 tests ±0    943 ✅ ±0  134 💤 ±0  0 ❌ ±0 
3 231 runs  ±0  2 829 ✅ ±0  402 💤 ±0  0 ❌ ±0 

Results for commit fd965a1. ± Comparison against base commit 3d00b33.

@jbonofre
jbonofre merged commit a8ff4fb into apache:main Oct 16, 2026
7 checks passed
@jbonofre
jbonofre deleted the fix-flaky-logtest branch October 16, 2026 03:57
jbonofre added a commit that referenced this pull request Oct 16, 2026
log:set updates the pax-logging configuration asynchronously, so reading it right after can fail with 'Unrecognized configuration' or return the previous level. Wait for the new level to be applied instead of failing right away.

log:list and ld are aliases, not command services: don't wait 30 seconds for a service that is never registered on each call.

(cherry picked from commit fd965a1)
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.

1 participant