-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test(itest): replace JDP with agent-based discovery #1560
base: main
Are you sure you want to change the base?
Conversation
Test image available:
|
Test image available:
|
Test image available:
|
Test image available:
|
Test image available:
|
Test image available:
|
Test image available:
|
Test image available:
|
ae247bc
to
b325b70
Compare
Test image available:
|
Test image available:
|
Test image available:
|
Test image available:
|
Test image available:
|
Test image available:
|
Test image available:
|
1e7c631
to
bae3d0d
Compare
Test image available:
|
Test image available:
|
Test image available:
|
Test image available:
|
Test image available:
|
fd61fe3
to
eb392d4
Compare
Test image available:
|
Test image available:
|
f2f7aca
to
11d0cdd
Compare
Test image available:
|
Test image available:
|
Welcome to Cryostat! 👋
Before contributing, make sure you have:
main
branch[chore, ci, docs, feat, fix, test]
git commit --amend --signoff
Related to #1553 - eliminates JDP from itest harness, so ARM64 images can be tested. Also just greatly reduces time spent waiting for JDP discovery/loss in integration testing, speeding up the run substantially.
As much as possible, I have tried to keep the existing tests' structure the same, and just swap out the underlying discovery implementation from relying on JDP to relying on Agent-based discovery. This was pretty straightforward since all of the "external targets" integration tests already used my
vertx-fib-demo
container, so I just needed to bump the version of that to a newer one that is built with the Cryostat Agent, and add a bit of logic to add environment variables to configure those agent instances. Other than that, a few tests also relied upon Cryostat being able to discover itself, which it previously did with JDP but would not anymore with agent-based discovery. I worked around that by having Cryostat define a Custom Target for itself before each test class (and remove it after each), in a way that is broadly compatible with the existing tests' expectations for what they would have seen from Cryostat discovering itself over JDP. Some tests needed some adjusting/loosening of particular expectations around target labels or annotations to compensate as well.For comparison, here is a recent CI test run which took just under 9 minutes to complete: https://github.com/cryostatio/cryostat/actions/runs/5283519061/jobs/9560039201
and here is the CI test run on this PR's changes: https://github.com/cryostatio/cryostat/actions/runs/5316093165/jobs/9625347531
The time savings are due to how the integration test harness has to wait for Cryostat to "lose" JDP targets in between many of the test classes. Since JDP is basically just a multicast packet heartbeat, target loss occurs when Cryostat's JDP client stops receiving heartbeats from a previously-seen JVM for a certain duration of time. So, after a test class completes, the test invokes Podman to stop the targets, and then waits for Cryostat to notice that they have all gone. With Agent discovery, invoking Podman to stop the containers sends a shutdown signal to the target JVMs, which the Agent intercepts, handles, and forwards. The Agent's signal handling then sends an immediate discovery plugin deregistration to Cryostat, which removes the Agent's target definition, so the time to wait for Cryostat's discovery to "settle" at the conclusion of a test class is very short, and the next test class can begin immediately.