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

[backport 23.0] TestDaemonRestartKillContainers: Fix races #45196

Merged
merged 2 commits into from
Mar 23, 2023

Commits on Mar 22, 2023

  1. TestDaemonRestartKillContainers: Fix loop capture

    TestDaemonRestartKillContainers test was always executing the last case
    (`container created should not be restarted`) because the iterated
    variables were not copied correctly.
    Capture iterated values by value correctly and rename c to tc.
    
    Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
    (cherry picked from commit fed1c96)
    Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
    vvoland committed Mar 22, 2023
    Configuration menu
    Copy the full SHA
    7f49ca2 View commit details
    Browse the repository at this point in the history
  2. StartWithLogFile: Fix d.cmd race

    Use `exec.Command` created by this function instead of obtaining it from
    daemon struct. This prevents a race condition where `daemon.Kill` is
    called before the goroutine has the chance to call `cmd.Wait`.
    
    Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
    (cherry picked from commit 88992de)
    Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
    vvoland committed Mar 22, 2023
    Configuration menu
    Copy the full SHA
    c6bf307 View commit details
    Browse the repository at this point in the history