You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "gnodet (via GitHub)" <gi...@apache.org> on 2026/10/07 12:16:40 UTC
[PR] CAMEL-25343: Fix flaky test SshIdleTimeoutTest.testIdleTimeoutExpiresBeforeCommandCompletes [camel]
gnodet opened a new pull request, #27498:
URL: https://github.com/apache/camel/pull/27498
## Summary
Fix the flaky test `SshIdleTimeoutTest.testIdleTimeoutExpiresBeforeCommandCompletes` which has failed 2 times and been flaky 7 times in the last 90 days (see [Develocity](https://develocity.apache.org/scans/tests?search.relativeStartTime=P90D&search.rootProjectNames=camel&search.timeZoneId=Europe%2FParis&tests.container=org.apache.camel.component.ssh.SshIdleTimeoutTest&tests.test=testIdleTimeoutExpiresBeforeCommandCompletes)), with a much higher failure rate under parallel builds (`-T1C`).
## Root Cause
The test had a 2:1 timing ratio between the server-side command delay (1000ms) and the client idle timeout (500ms). Apache MINA SSHD's idle timeout is **not a hard real-time timer** — it is checked periodically by the I/O event loop, and crucially the idle clock only starts **after the SSH handshake and channel open complete** (both of which reset the idle timer). Under CI load with scheduling jitter, the combined overhead can consume most of the 1000ms window, letting the command finish before the idle timeout fires.
The failure mode:
```
org.opentest4j.AssertionFailedError: Exit value should be null because the session was closed by idle timeout before the command completed ==> expected: <null> but was: <0>
```
## Fix
Increase `DelayedEchoCommandFactory` command delay from **1000ms → 5000ms**, giving a **10:1 ratio** (5000ms delay vs 500ms idle timeout). This makes the race condition negligible even under heavy CI load. Also:
- Update `sshWithShortIdleTimeout` route: `timeout=5000` → `timeout=10000` (must survive the 5s command delay)
- Update `sshWithLongIdleTimeout` route: `idleTimeout=5000` → `idleTimeout=30000`, `timeout=5000` → `timeout=30000`
- Fix stale comments that referenced "3s command delay"
## Testing
All 6 tests in `SshIdleTimeoutTest` pass locally.
---
_Hermes Agent on behalf of gnodet_
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25343: Fix flaky test SshIdleTimeoutTest.testIdleTimeoutExpiresBeforeCommandCompletes [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27498:
URL: https://github.com/apache/camel/pull/27498#issuecomment-6037723773
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
* You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25343: Fix flaky test SshIdleTimeoutTest.testIdleTimeoutExpiresBeforeCommandCompletes [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #27498:
URL: https://github.com/apache/camel/pull/27498
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25343: Fix flaky test SshIdleTimeoutTest.testIdleTimeoutExpiresBeforeCommandCompletes [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27498:
URL: https://github.com/apache/camel/pull/27498#issuecomment-6038124434
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `components/camel-ssh`
---
<details><summary>:microscope: Scalpel shadow comparison — Scalpel: 1 of 699 tested, 0 compile-only — current: 13 all tested</summary>
[Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **1 affected modules** (current approach: 13).
**Skip-tests mode would test 1 modules** (1 direct + 0 downstream), **skip tests for 0** (generated code, meta-modules)
<details><summary>Modules only in current approach (12)</summary>
- `camel-azure-files`
- `camel-ftp`
- `camel-jbang-mcp`
- `camel-jbang-plugin-mcp`
- `camel-jbang-plugin-route-parser`
- `camel-jbang-plugin-tui`
- `camel-jbang-plugin-validate`
- `camel-jsch`
- `camel-launcher-container`
- `camel-yaml-dsl-validator`
- `camel-yaml-dsl-validator-maven-plugin`
- `camel-zookeeper-master`
</details>
<details><summary>Modules Scalpel would test (1)</summary>
- `camel-ssh` ← components/camel-ssh/src/test/java/org/apache/camel/component/ssh/SshIdleTimeoutTest.java
</details>
> :information_source: Shadow mode — Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
</details>
<details><summary>All tested modules (13 modules, 2m 32s total)</summary>
**Total reactor time:** 2m 32s
| Module | Duration | Status |
| --- | --- | --- |
| Camel :: JBang :: MCP | 40.1s | SUCCESS |
| Camel :: SSH | 28.2s | SUCCESS |
| Camel :: Jsch | 26.0s | SUCCESS |
| Camel :: JBang :: Plugin :: Validate | 25.0s | SUCCESS |
| Camel :: YAML DSL :: Validator | 19.3s | SUCCESS |
| Camel :: Azure :: Files | 5.2s | SUCCESS |
| Camel :: YAML DSL :: Validator Maven Plugin | 3.1s | SUCCESS |
| Camel :: JBang :: Plugin :: Route Parser | 2.0s | SUCCESS |
| Camel :: Launcher :: Container | 1.8s | SUCCESS |
| Camel :: JBang :: Plugin :: MCP | 1.2s | SUCCESS |
| Camel :: FTP | n/a | |
| Camel :: JBang :: Plugin :: TUI | n/a | |
| Camel :: Zookeeper Master | n/a | |
**Top 20 slowest modules:**
- `Camel :: JBang :: MCP` (40.1s)
- `Camel :: SSH` (28.2s)
- `Camel :: Jsch` (26.0s)
- `Camel :: JBang :: Plugin :: Validate` (25.0s)
- `Camel :: YAML DSL :: Validator` (19.3s)
- `Camel :: Azure :: Files` (5.2s)
- `Camel :: YAML DSL :: Validator Maven Plugin` (3.1s)
- `Camel :: JBang :: Plugin :: Route Parser` (2.0s)
- `Camel :: Launcher :: Container` (1.8s)
- `Camel :: JBang :: Plugin :: MCP` (1.2s)
</details>
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/37619847358)
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org