davsclaus opened a new pull request, #3138:
URL: https://github.com/apache/camel-kamelets/pull/3138

   ## Problem
   
   `JiraIT.jira()[2]` (`jira-source-route-test`) failed in the itest run of 
#3114 (Citrus 5.1.0 bump):
   
   ```
   Values not equal for header element 'citrus_http_query_params(expand)',
   expected 'schema,names' but was 'schema,names,transitions'
   ```
   
   The request it got was not from the jira-source route. It arrived 3 ms after 
that route was launched, and it was a leftover getIssue 
(`expand=schema,names,transitions`) from the previous test, 
`jira-add-comment-sink-route-test`.
   
   ## Root cause
   
   The Jira sink routes use `timer-source` with a repeating 10s period, and all 
Jira tests share one `jiraServer`.
   
   1. The test ends with `camel:cli:stop`, which runs `camel stop <pid>`. That 
command returns before the Camel JVM has actually exited.
   2. The `afterJira` purge then runs, waiting at most 100 ms for queued 
requests.
   3. If the timer's second firing lands between the purge and the JVM exiting, 
its getIssue request reaches `jiraServer` after the purge. The next test then 
receives it as its first request.
   
   In the failing run the add-comment timer fired at 06:53:57.2. The stop 
returned at 06:54:06.9, so the second firing was due at 06:54:07.2, right 
inside that window.
   
   This is a timing race in the test, not a Citrus 5.1.0 regression. I 
reproduced it on **main with Citrus 5.0.2** by setting the add-comment period 
to 6s, which produced exactly the CI error. JiraIT also passes locally with 
Citrus 5.1.0.
   
   ## Fix
   
   Add `repeatCount: 1` to the timer in both Jira sink routes, so each route 
sends exactly one exchange and nothing can reach the mock server after the 
purge.
   
   ## Verification
   
   - JiraIT passes with Citrus 5.0.2 and 5.1.0 (`-Dcitrus.version=...`); the 
app log shows `repeatCount = 1` applied.
   - With the forced 6s period: 2/2 runs passed with the fix; 1 of 2 runs 
failed without it.
   - `./mvnw verify` from the root passes.
   
   Once this is merged, #3114 can be rebased (`@dependabot rebase`).
   
   _Claude Code on behalf of Claus Ibsen_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
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]

Reply via email to