Skip to content

test(e2e): follow-ups to the checks that a guest has booted - #1289

Open
richardcase wants to merge 3 commits into
mainfrom
issue_1267
Open

richardcase wants to merge 3 commits into
mainfrom
issue_1267

Conversation

@richardcase

Copy link
Copy Markdown
Member

Three small changes to the e2e tests, left from the review of #1264 and filed as #1267. None of them changes what a run of the suite shows today. One commit per item.

1. The negative tests call waitForBoot (test/e2e/boot_failure_test.go)

The tests of a guest that cannot boot made the same checks as waitForBoot with their own calls, so a waitForBoot which passed for every guest would have failed no test. They now also call it, through gomega's InterceptGomegaFailure, and check the reason it fails for:

  • kernel without PVH: the VMM has exited, the wait stops at once ("did not keep running")
  • guest without an init, Firecracker: the same
  • guest without an init, Cloud Hypervisor: the VMM keeps running, so waitForBoot waits for the marker until its timeout ("boot marker"). This is the only guest which exercises the marker check, and the subtest takes 30 seconds longer for it.

The timeout is now a parameter of waitForBoot. The checks the tests made themselves stay, they show things waitForBoot does not: that a failed VMM stays down, and that there is one pid file.

2. ConsoleMarker finds the marker next to an escape sequence (test/e2e/utils/checks.go)

The pattern has nothing before or after the marker any more. The uptime still has to be a number, so the user-data as it was given to the guest does not match, and a longer namespace or name cannot match because the marker has them between fixed texts. The existing unit cases show both, and a case with escape sequences on both sides is added.

A line of the kernel in the middle of the message is not found by any pattern on one line. That part of the issue is left as it is.

3. TestNewMicroVMSpecUsesTheProvider does not name the kernels (test/e2e/harness_test.go)

The test runs for each known provider and compares the spec with the fields of the provider. TestKernelWithoutPVHIsNotAKernelOfAProvider stays as the guard that the literal names once were.

Verification

  • Unit tests of the harness, make compile-e2e, make lint and make test pass on each commit.
  • Hosted e2e on this branch: run link to follow in a comment.
  • Proof for item 1: a throwaway branch with a waitForBoot which returns before the marker check, run in the hosted e2e so that the negative tests are seen to fail. Link to follow in a comment.

Closes #1267.

The tests of a guest that boots rely on waitForBoot, and the tests of a
guest that cannot boot made the same checks with their own calls of
VerifyVMM and ConsoleMarker. A waitForBoot which passed for every guest,
for instance one that returned before the check of the marker, would have
failed no test.

The negative tests now also call waitForBoot, through gomega's
InterceptGomegaFailure, and check that it fails for the reason they
expect. For a VMM which has exited the wait stops at once. For the Cloud
Hypervisor guest without an init, whose VMM keeps running, it waits for
the marker until its timeout, so that one subtest takes 30 seconds
longer. The timeout is now a parameter of waitForBoot, the tests of a
guest which boots pass bootTimeout as before.

The checks the tests made themselves stay: they show that a failed VMM
stays down and that there is one pid file, which waitForBoot does not.

Part of #1267.

Signed-off-by: Richard Case <richard.case@outlook.com>
The pattern of ConsoleMarker needed a space or the end of the line on
both sides of the marker. A colour code after the uptime, or before the
marker, would have made a test fail for a guest which has booted.

The pattern now has nothing before or after the marker. The uptime still
has to be a number, so the user-data as it was given to the guest does
not match. A longer namespace or name cannot match either: the marker
starts with a fixed text and has the namespace and the name between
fixed texts, which the existing cases of the test show.

A line of the kernel in the middle of the message is not found by any
pattern on one line, and is left as it is.

Part of #1267.

Signed-off-by: Richard Case <richard.case@outlook.com>
TestNewMicroVMSpecUsesTheProvider had the name of the kernel image of
each provider. It had to be changed each time a provider got another
kernel, and said little about NewMicroVMSpec.

The test now runs for each known provider and compares the spec with the
fields of the provider. TestKernelWithoutPVHIsNotAKernelOfAProvider
stays as the check that no provider boots with the kernel of the test of
a guest which cannot boot, which the literal names once caught.

Closes #1267.

Signed-off-by: Richard Case <richard.case@outlook.com>
Copilot AI balanced review requested due to automatic review settings October 9, 2026 11:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@netlify

netlify Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for flintlock-docs canceled.

Name Link
🔨 Latest commit 1ae517f
🔍 Latest deploy log https://app.netlify.com/projects/flintlock-docs/deploys/6ac8d5cd6af9a70008a1e476

@richardcase richardcase added kind/test Updates to tests only area/testing Indicates an issue related to test labels Oct 9, 2026
@richardcase

richardcase commented Oct 9, 2026 •

Copy link
Copy Markdown
Member Author

Hosted e2e on this branch, both providers: https://github.com/liquidmetal-dev/flintlock/actions/runs/37926554148, passed.

Each negative test logs that waitForBoot did not pass, for the reason it expects:

Test Line in the log
kernel without PVH waitForBoot did not pass: Told to stop trying after 0.000s. (the VMM has exited)
guest without an init, firecracker waitForBoot did not pass: Told to stop trying after 0.000s. (the VMM has exited)
guest without an init, cloudhypervisor waitForBoot did not pass: Timed out after 30.002s. (the VMM runs, the marker is not there)

Proof for item 1: https://github.com/liquidmetal-dev/flintlock/actions/runs/37926628657, a throwaway branch on top of this one where waitForBoot ignores the error of ConsoleMarker, failed:

boot_failure_test.go:348:
    waitForBoot passed for a guest which has not booted

in TestE2EGuestWithoutInit/cloudhypervisor, the one guest whose VMM keeps running. The two other negative tests still fail waitForBoot on the VMM which has exited, as expected. The branch is deleted.

Checks: the lint job fails at "Log in to Buf Schema Registry" with invalid token provided for buf.build. That step last ran and passed on 2026-10-03 and was skipped on every run in between, so the BUF_TOKEN secret has become invalid since. pr_type has failed at startup on every pull request since 31c5723 (2024-07-10): the organisation's list of allowed actions does not have the form the action was pinned in. #1290 fixes that, and adds kind/test to the labels the check accepts, which this pull request carries.

richardcase added a commit that referenced this pull request Oct 9, 2026
…has it

The pr_type workflow has failed at startup on every pull request since
31c5723 (2024-07-10), so no pull request has had its kind label checked
since then. That commit pinned the docker action as
docker://index.docker.io/agilepathway/pull-request-label-checker:latest@sha256:...
The organisation only allows the actions on its list, which has
docker://agilepathway/pull-request-label-checker:* and not the form with
index.docker.io. A pinning tool writes that form, which is noted in the
workflow.

The action is now referenced as the list has it, pinned by the digest of
the current latest image.

kind/test is added to the labels the check accepts. The pull requests
which only change tests carry it, such as #1260 and #1289, and the check
would fail them as soon as it runs again.

Signed-off-by: Richard Case <richard.case@outlook.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/testing Indicates an issue related to test kind/test Updates to tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

e2e: follow-ups to the checks that a guest has booted

2 participants