Fix flaky tests (batch 14): SSL, BacklogTracer, CXF timeout, Quartz#24713
Fix flaky tests (batch 14): SSL, BacklogTracer, CXF timeout, Quartz#24713gnodet wants to merge 2 commits into
Conversation
…tivityTest, CxfTimeoutTest, QuartzPersistentStoreTest - SSLContextParametersTest: Accept both null (JDK <=23) and populated array (JDK 24+) for SSLParameters.getSignatureSchemes() default - BacklogTracer: Make enabled, standby, and activityEnabled fields volatile to prevent JIT register caching and stale cross-thread reads - CxfTimeoutTest: Increase GreeterImplWithSleep from 2s to 10s to reliably trigger the 100ms ReceiveTimeout under CI load - SpringQuartzPersistentStoreRestartAppChangeOptionsTest: Add @isolated to prevent JMX MBean name collisions with concurrent test classes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
gnodet
left a comment
There was a problem hiding this comment.
Good batch of targeted flaky-test fixes — the Develocity analytics references are excellent for traceability.
Findings:
-
SSLContextParametersTest — incomplete JDK 24+ fix (medium): The first assertion block is correctly updated with
assertDefaultSignatureSchemes, but the "clear explicit schemes, keep filter" section at lines ~1035-1047 has the same JDK 24+ sensitivity. On JDK 24+,getSignatureSchemes()returns a non-null populated defaults array, so the.*include filter will match all of them andassertEquals(0, ...)will still fail. The comment at line 1044 ("JDK defaults are null -> filtering null gives empty array") is also stale on JDK 24+. This section likely needs the same JDK-version-aware treatment. -
BacklogTracer
volatileadditions — well-targeted.enabled/standbyare read on event notification threads (viaActivityEventNotifier.isDisabled()) while written from JMX threads.activityEnabledhas the same pattern. Correct and minimal fix. -
@Isolatedon Quartz restart test — right tool for the job. The test creates multiple CamelContexts with management names that can collide with concurrent test classes on JMX MBean registration. -
CXF
Thread.sleep(10000)— the increase from 2s to 10s is reasonable against the 100ms client timeout. The sleep runs in the background while the client times out quickly, so test duration isn't materially affected.
This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.
Claude Code review on behalf of @gnodet
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🐫 Apache Camel Committers, please review the following items:
|
|
🧪 CI tested the following changed modules:
🔬 Scalpel shadow comparison — Scalpel: 545 tested, 29 compile-only — current: 545 all testedMaveniverse Scalpel detected 574 affected modules (current approach: 545).
|
…Timeout The CxfTimeoutTest was flaky because the 100ms ReceiveTimeout configured via the wildcard http-conduit in cxfConduitTimeOutContext.xml was not always being applied. The JAX-WS server published in @BeforeAll creates a default CXF Bus without the timeout configuration. Under CI load, the client conduit could resolve against this wrong Bus and miss the 100ms timeout entirely, causing the test to receive a successful response instead of the expected HttpTimeoutException. The previous fix (increasing GreeterImplWithSleep from 2s to 10s) would not resolve this because without the 100ms timeout, the effective timeout defaults to 60s (CXF default), and 10s < 60s. Fix: add a TimeoutCxfConfigurer that explicitly sets ReceiveTimeout=100 on each conduit, bypassing Bus-level configuration entirely. Revert GreeterImplWithSleep back to 2s since the sleep duration was never the root cause. Also add a comment on BacklogTracer volatile fields explaining why only enabled, standby, and activityEnabled need volatile (toggled at runtime via JMX) while other boolean fields do not (set during initialization). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
/retest |
Claude Code on behalf of gnodet
Summary
Fix four flaky tests identified by Develocity:
1.
SSLContextParametersTest.testSignatureSchemesFilter(5.4% flaky)nullwhen no explicit filtering is configured.null(pre-JDK 24) and the default scheme list (JDK 24+) via a helper methodassertDefaultSignatureSchemes.2.
BacklogTracerActivityTest— all 3 methods (3.9% flaky)enabled,standby, andactivityEnabledfields lackedvolatile, causing routing threads to not see updates from management/test threads.volatile. Added comment explaining why only these three need volatile (toggled at runtime via JMX) while other boolean fields don't (set during initialization).3.
CxfTimeoutTest— all 5 timeout methods (0.3%–0.9% flaky)ReceiveTimeoutconfigured via wildcardhttp-conf:conduitincxfConduitTimeOutContext.xmlwas not always being applied. The JAX-WS server published in@BeforeAllcreates a default CXF Bus without that configuration. Under CI load, the client conduit could resolve against the wrong Bus and miss the 100ms timeout entirely, receiving a successful response instead ofHttpTimeoutException.TimeoutCxfConfigurerthat explicitly setsReceiveTimeout=100on each conduit, independent of Bus-level configuration. RevertedGreeterImplWithSleepsleep back to 2s since the sleep duration was never the root cause (without the 100ms timeout, the effective timeout defaults to 60s, and even 10s < 60s).@Isolatedfix (commit a8a51e5) addressed a different failure mode (port conflicts). This fix addresses the remaining Bus lifecycle race.4.
SpringQuartzPersistentStoreRestartAppChangeOptionsTest— all 3 methods (0.8%–1.7% flaky)ObjectNamecollision when run in parallel —CamelContext ... is already registered.@Isolatedannotation.Develocity Evidence
All fixes verified against method-level flakiness data and actual failure stack traces from Develocity.