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

   `DatabaseIT.debezium()[4]` (`debezium-sqlserver-source-route-test`) has 
failed on main since 2026-11-27 (for example run 46245502237, and the 
Dependabot PRs #3399, #3400, #3403).
   
   ## Cause
   
   The setup SQL runs inside `repeatOnError`. On CI the first attempt creates 
`testdb`, then `sp_cdc_enable_table` fails while SQL Server Agent is still 
starting:
   
   ```
   Msg 22832 ... sp_cdc_enable_table_internal
   ... The failure occurred when executing the command '[sys].[sp_cdc_add_job] 
@job_type = N'capture''
   ```
   
   Every retry then starts again with `CREATE DATABASE testdb` and fails with 
`Msg 1801 Database 'testdb' already exists`. So the retry loop can never 
recover, and the test fails after 30 attempts.
   
   ## Fix
   
   Each setup statement now checks first whether an earlier attempt has already 
done it. That covers the database, the two tables plus the seed row, the login 
and the user, CDC on the database, and CDC on `products`. A retry then picks up 
where the failed attempt stopped. The test itself is unchanged.
   
   ## Testing
   
   - Against a SQL Server 2022 container (the test's image), the guarded script:
     - succeeds when it runs twice in a row;
     - turns CDC back on after it was turned off on `products` (the half-done 
state), and the `capture` and `cleanup` jobs are there.
   - `mvn verify -Dtest=DatabaseIT#debezium` in `tests/camel-kamelets-itest`: 
all 6 Debezium tests pass locally, `debezium-sqlserver-source-route-test` among 
them.
   - The Agent startup race happened only on CI and I could not trigger it 
locally, so the retry path itself was tested with the half-done state, not the 
real race.
   
   Integration Tests group 3 also fails on main, in `AiToolIT.aiTool()`, which 
this PR doesn't touch.
   
   _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