Skip to content
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

Draft
wants to merge 40 commits into
base: main
Choose a base branch
from

Conversation

andrewazores
Copy link
Member

@andrewazores andrewazores commented Jun 16, 2023

Welcome to Cryostat! 👋

Before contributing, make sure you have:

  • Read the contributing guidelines
  • Linked a relevant issue which this PR resolves
  • Linked any other relevant issues, PR's, or documentation, if any
  • Resolved all conflicts, if any
  • Rebased your branch PR on top of the latest upstream main branch
  • Attached at least one of the following labels to the PR: [chore, ci, docs, feat, fix, test]
  • 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.

@github-actions github-actions bot added the needs-triage Needs thorough attention from code reviewers label Jun 16, 2023
@mergify mergify bot added the safe-to-test label Jun 16, 2023
@andrewazores andrewazores added test and removed needs-triage Needs thorough attention from code reviewers labels Jun 16, 2023
@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-69e01bc98df0c7b8a6708b60172a096c7e176a35-linux-arm64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-69e01bc98df0c7b8a6708b60172a096c7e176a35-linux-amd64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-6a0a27ca601f54d7fb75421a335db13967f39013-linux-amd64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-6a0a27ca601f54d7fb75421a335db13967f39013-linux-arm64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-72e438c8af8b7448e97b0a433f599f066d6e1afd-linux-arm64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-72e438c8af8b7448e97b0a433f599f066d6e1afd-linux-amd64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-73c6b6e82f5648355d9d75c705d33e7cd4257148-linux-arm64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-73c6b6e82f5648355d9d75c705d33e7cd4257148-linux-amd64 sh smoketest.sh

@andrewazores andrewazores force-pushed the itest-agent-discovery branch 2 times, most recently from ae247bc to b325b70 Compare June 20, 2023 13:28
@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-ae247bc24448d4ed019a12c4c3a3446511e82ef7-linux-amd64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-ae247bc24448d4ed019a12c4c3a3446511e82ef7-linux-arm64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-b325b70ab4f6e895153431be31d12a43a1e499b0-linux-arm64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-b325b70ab4f6e895153431be31d12a43a1e499b0-linux-amd64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-eb392d4dafddb52b2b80236f439f24b2f6058c36-linux-arm64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-eb392d4dafddb52b2b80236f439f24b2f6058c36-linux-amd64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-1e7c631a2396a0f688c9ee7623fed7f8a1711a14-linux-arm64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-1e7c631a2396a0f688c9ee7623fed7f8a1711a14-linux-amd64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-bae3d0d4604d78824204b0ddcd20dbc5812ebf9c-linux-arm64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-bae3d0d4604d78824204b0ddcd20dbc5812ebf9c-linux-amd64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-fd61fe3b89bf839405338262fc4275c5047e14b6-linux-arm64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-fd61fe3b89bf839405338262fc4275c5047e14b6-linux-amd64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-eb392d4dafddb52b2b80236f439f24b2f6058c36-linux-amd64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-eb392d4dafddb52b2b80236f439f24b2f6058c36-linux-arm64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-11d0cdd2f90ff6dc604c06267d20ac1ba54cdfbf-linux-amd64 sh smoketest.sh

@github-actions
Copy link
Contributor

Test image available:

$ CRYOSTAT_IMAGE=ghcr.io/cryostatio/cryostat:pr-1560-11d0cdd2f90ff6dc604c06267d20ac1ba54cdfbf-linux-arm64 sh smoketest.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

None yet

1 participant