Skip to content

CI: tests sending signals to be caught by in-container shell scripts are racy #3908

Closed

Description

@apostasie

Description

See recent regression with TestStopWithStopSignal in: https://github.com/containerd/nerdctl/actions/runs/13462973052/job/37622397545
and comment in
#3892 (comment)

The fundamental problem seems to be that sending the signal may race the shell script setting up the trap.

Overall, we should consume the container logs first and check that the trap is fully set (greping for "script ready" or some other way for the script to signal the trap is set) before sending the signal.

This applies to tests relying on an in-container trap. Currently:

  • TestRunSigProxy <- this one is currently somewhat safe as it forces wait 3 seconds (though arbitrary length waits are fragile and not a proper solution)
  • TestStopWithStopSignal
  • probably TestRestartWithSignal

Steps to reproduce the issue

Describe the results you received and expected

na

What version of nerdctl are you using?

main

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

No response

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions