cryostat-legacy
cryostat-legacy copied to clipboard
test(itest): replace JDP with agent-based discovery
Welcome to Cryostat! 👋
Before contributing, make sure you have:
- [x] Read the contributing guidelines
- [x] Linked a relevant issue which this PR resolves
- [x] Linked any other relevant issues, PR's, or documentation, if any
- [x] Resolved all conflicts, if any
- [x] Rebased your branch PR on top of the latest upstream
main
branch - [x] Attached at least one of the following labels to the PR:
[chore, ci, docs, feat, fix, test]
- [x] Signed the last commit:
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.
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-69e01bc98df0c7b8a6708b60172a096c7e176a35-linux-arm64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-69e01bc98df0c7b8a6708b60172a096c7e176a35-linux-amd64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-6a0a27ca601f54d7fb75421a335db13967f39013-linux-amd64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-6a0a27ca601f54d7fb75421a335db13967f39013-linux-arm64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-72e438c8af8b7448e97b0a433f599f066d6e1afd-linux-arm64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-72e438c8af8b7448e97b0a433f599f066d6e1afd-linux-amd64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-73c6b6e82f5648355d9d75c705d33e7cd4257148-linux-arm64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-73c6b6e82f5648355d9d75c705d33e7cd4257148-linux-amd64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-ae247bc24448d4ed019a12c4c3a3446511e82ef7-linux-amd64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-ae247bc24448d4ed019a12c4c3a3446511e82ef7-linux-arm64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-b325b70ab4f6e895153431be31d12a43a1e499b0-linux-arm64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-b325b70ab4f6e895153431be31d12a43a1e499b0-linux-amd64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-eb392d4dafddb52b2b80236f439f24b2f6058c36-linux-arm64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-eb392d4dafddb52b2b80236f439f24b2f6058c36-linux-amd64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-1e7c631a2396a0f688c9ee7623fed7f8a1711a14-linux-arm64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-1e7c631a2396a0f688c9ee7623fed7f8a1711a14-linux-amd64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-bae3d0d4604d78824204b0ddcd20dbc5812ebf9c-linux-arm64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-bae3d0d4604d78824204b0ddcd20dbc5812ebf9c-linux-amd64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-fd61fe3b89bf839405338262fc4275c5047e14b6-linux-arm64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-fd61fe3b89bf839405338262fc4275c5047e14b6-linux-amd64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-eb392d4dafddb52b2b80236f439f24b2f6058c36-linux-amd64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-eb392d4dafddb52b2b80236f439f24b2f6058c36-linux-arm64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-eb392d4dafddb52b2b80236f439f24b2f6058c36-linux-amd64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-eb392d4dafddb52b2b80236f439f24b2f6058c36-linux-arm64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-4c0c6c8fc31ef9bcd48ee1cbbc8d4ee9e122b750-linux-arm64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-4c0c6c8fc31ef9bcd48ee1cbbc8d4ee9e122b750-linux-amd64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-5ee61e5487d4f40952d962cc85abe88935406bba-linux-amd64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-5ee61e5487d4f40952d962cc85abe88935406bba-linux-arm64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-5f65c51c323f843de3d55b9b02d2141a7f20c59e-linux-amd64 sh smoketest.sh
Test image available:
$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-5f65c51c323f843de3d55b9b02d2141a7f20c59e-linux-arm64 sh smoketest.sh