davsclaus opened a new pull request, #30848: URL: https://github.com/apache/camel/pull/30848
## Description [CAMEL-27562](https://issues.apache.org/jira/browse/CAMEL-27562) is the test refactoring that was left over from CAMEL-21278. It fixes the parts of the camel-jbang-plugin-kubernetes tests that break the test rules in AGENTS.md: - **Fixed 2 s waits.** `KubernetesPodLogs` slept a fixed 2 s between retries. The mock server answers the log of a running pod with one line, so `shouldGetPodLogs` retried 10 times and took 20 s, and `shouldHandlePodNotFound` took 2 s. The command now waits `retryDelayMillis`, which is still 2 s by default and which the tests set to 10 ms. `KubernetesPodLogsTest` now takes 0.2 s instead of 22 s. - **Assertions.** `shouldGetPodLogs` checked only the exit code; it now checks that the command retried and stopped. `theLogOfAFinishedPodIsReadOnce` asserted that the call took less than 2 s, which a loaded CI machine does not guarantee. It now relies on its "no Retry" check. - **Shared home directory.** `KubernetesBaseTestSupport` set the home of the CLI to the fixed directory `target` in `@BeforeAll` and never set it back. `KubernetesRunClusterTypeTest` and `KubernetesRunCustomTest` did the same in `@BeforeEach`. Each now uses a temporary home of its own and restores the previous one. The two run tests also clear the static Kubernetes client of their mock server after each test. Most of the remaining time (about 180 s of the module's 184 s locally) is the tests that run Maven and JKube for `camel kubernetes run`, about 5 s each. Running them is what they test, and CI already skips them (`ci.env.name`), so they are left as they are. ## Testing The whole module passes: 181 tests in 184 s, compared with 205 s before. _Claude Code on behalf of davsclaus_ 🤖 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]
