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

Tests for disconnections during lxc exec #284

Merged
merged 6 commits into from
Sep 18, 2024

Conversation

hamistao
Copy link
Contributor

@hamistao hamistao commented Sep 6, 2024

As was discussed with @mihalicyn If containers are stopped gracefully, the exit code can be 129(SIGHUP) or 143(SIGTERM) depending on the signal used, both results have been seen and make sense. If forcefully stopping a container the exit code is always 137 (SIGKILL). For VMs, the exit code was standardized as 129 for all cases by #13875 (not merged yet).

In its current state, this PR only adds tests for forcefully stopping containers and VMs.

@simondeziel
Copy link
Member

There are too many commits in here, @hamistao did something went wrong when pushing/opening the PR?

@hamistao hamistao force-pushed the reboot_experience_improv_tests branch from f5ae15b to 7a05cb3 Compare September 6, 2024 20:29
tests/vm Fixed Show fixed Hide fixed
@hamistao hamistao force-pushed the reboot_experience_improv_tests branch 2 times, most recently from 9a612c8 to 53d9683 Compare September 6, 2024 20:31
@hamistao hamistao marked this pull request as draft September 6, 2024 20:31
@hamistao
Copy link
Contributor Author

hamistao commented Sep 6, 2024

@simondeziel Yes I messed up my rebase, I should have opened this as a draft. Sorry about that.

@hamistao hamistao force-pushed the reboot_experience_improv_tests branch 5 times, most recently from 0a38f38 to ec1e9dc Compare September 6, 2024 20:39
@hamistao hamistao marked this pull request as ready for review September 6, 2024 20:41
@hamistao
Copy link
Contributor Author

hamistao commented Sep 6, 2024

@simondeziel Fixed, this should not be merged yet since the VM fix tested here is not in LXD yet, but feel free to take a look whenever you can.

@simondeziel
Copy link
Member

@simondeziel Yes I messed up my rebase, I should have opened this as a draft. Sorry about that.

No worries at all!

tests/container Outdated Show resolved Hide resolved
tests/vm Outdated Show resolved Hide resolved
@hamistao hamistao force-pushed the reboot_experience_improv_tests branch from 2c8a847 to c96f034 Compare September 9, 2024 15:14
@tomponline
Copy link
Member

@simondeziel happy with this?

@hamistao hamistao marked this pull request as draft September 12, 2024 08:40
@hamistao hamistao force-pushed the reboot_experience_improv_tests branch 2 times, most recently from 42c07fc to 0ba22da Compare September 12, 2024 10:59
tests/container Outdated Show resolved Hide resolved
tests/container Outdated Show resolved Hide resolved
tests/vm Outdated Show resolved Hide resolved
@hamistao hamistao force-pushed the reboot_experience_improv_tests branch from 0ba22da to 2146528 Compare September 12, 2024 20:42
@hamistao hamistao marked this pull request as ready for review September 13, 2024 10:44
@hamistao
Copy link
Contributor Author

hamistao commented Sep 13, 2024

@simondeziel This is ready for another review. I believe the failing tests are unrelated to these changes since all modified files' tests pass.

tests/vm Show resolved Hide resolved
@hamistao hamistao marked this pull request as draft September 13, 2024 13:26
@hamistao hamistao force-pushed the reboot_experience_improv_tests branch 3 times, most recently from 2f00d90 to 707e85c Compare September 16, 2024 13:58
@hamistao
Copy link
Contributor Author

@simondeziel I keep getting a context deadline exceeded error in the VM clean stop tests.
If you agree, I suggest removing those tests and open this for another review.

Copy link
Member

@simondeziel simondeziel left a comment

Choose a reason for hiding this comment

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

https://github.com/canonical/lxd-ci/actions/runs/10885376800/job/30202865680?pr=284 taking ~2h feels like a bug as I'd expect lxc stop to timeout before that long, no?

That said, I think the context deadline bit might be addressed by waiting for complete boot before doing the shutdown.

tests/vm Outdated

# Launch test instance
lxc launch "${IMAGE}" vm1 --vm
waitInstanceReady vm1
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
waitInstanceReady vm1
waitInstanceBooted vm1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

taking ~2h feels like a bug as I'd expect lxc stop to timeout before that long, no?

I think the timeout is indeed very long so this should be expected

That said, I think the context deadline bit might be addressed by waiting for complete boot before doing the shutdown.

Yeah, that makes sense, thanks!

tests/vm Outdated
echo "==> Test cleanly stopping a VM"
lxc stop vm1
lxc start vm1
waitInstanceReady vm1
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
waitInstanceReady vm1
waitInstanceBooted vm1

@hamistao hamistao force-pushed the reboot_experience_improv_tests branch from 707e85c to b196f12 Compare September 16, 2024 21:17
@hamistao hamistao marked this pull request as ready for review September 18, 2024 00:43
@hamistao
Copy link
Contributor Author

@simondeziel This is ready again

tests/vm Outdated Show resolved Hide resolved
@hamistao hamistao force-pushed the reboot_experience_improv_tests branch from b196f12 to 8e4438c Compare September 18, 2024 01:09
@tomponline tomponline merged commit 2b02a0b into canonical:main Sep 18, 2024
128 of 136 checks passed
@hamistao hamistao deleted the reboot_experience_improv_tests branch September 18, 2024 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants