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

Add test for signals #756

Merged
merged 1 commit into from
Dec 5, 2024
Merged

Add test for signals #756

merged 1 commit into from
Dec 5, 2024

Conversation

jprendes
Copy link
Collaborator

@jprendes jprendes commented Dec 2, 2024

This PR adds test for sending signals to containers.
This is the first step towards fixing #755.

Running:

USE_LIBC=0 cargo test -p containerd-shim-wasm -- test::signals::test_handling_signals --exact --show-output --nocapture --ignored

is very likely to stall

While running:

USE_LIBC=1 cargo test -p containerd-shim-wasm -- test::signals::test_handling_signals --exact --show-output --nocapture --ignored

does succeed without problems.

The main difference is that the first one uses tokio::signal, while the second one uses libc::signal.

Commenting out the containerd::Client code in crates/containerd-shim-wasm/src/sys/unix/container/instance.rs prevents tokio from being used in the shim, and both versions of the test pass reliably.

@jprendes jprendes requested review from andreiltd and Mossaka December 2, 2024 16:08
@jprendes jprendes force-pushed the test-signals branch 2 times, most recently from 70f9b20 to ab25a75 Compare December 2, 2024 17:18
Copy link
Member

@Mossaka Mossaka left a comment

Choose a reason for hiding this comment

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

Great to see more tests being added!

I do believe this change should be appended as a "Added" section to the CHANGELOG since it's adding a new test feature.

crates/containerd-shim-wasm/src/lib.rs Outdated Show resolved Hide resolved
crates/containerd-shim-wasm/src/test/signals.rs Outdated Show resolved Hide resolved
crates/containerd-shim-wasm/src/test/signals.rs Outdated Show resolved Hide resolved
Signed-off-by: Jorge Prendes <[email protected]>
Copy link
Member

@Mossaka Mossaka left a comment

Choose a reason for hiding this comment

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

LGTM!

@Mossaka Mossaka merged commit 215c1aa into containerd:main Dec 5, 2024
71 checks passed
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.

2 participants