Skip to content

Commit

Permalink
Merge pull request containerd#6515 from gabriel-samfira/enable-restar…
Browse files Browse the repository at this point in the history
…t-monitor

[Windows][Integration] Enable TestRestartMonitor
  • Loading branch information
estesp authored Feb 16, 2022
2 parents 67bd2e9 + b63000c commit 39afc6f
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions integration/client/restart_monitor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,6 @@ func newDaemonWithConfig(t *testing.T, configTOML string) (*Client, *daemon, fun
// TestRestartMonitor tests restarting containers
// with the restart monitor service plugin
func TestRestartMonitor(t *testing.T) {
if runtime.GOOS == "windows" {
// This test on Windows encounters the following error in some environments:
// "The process cannot access the file because it is being used by another process. (0x20)"
// Skip this test until this error can be evaluated and the appropriate
// test fix or environment configuration can be determined.
t.Skip("Skipping flaky test on Windows")
}
const (
interval = 10 * time.Second
epsilon = 1 * time.Second
Expand Down Expand Up @@ -188,10 +181,24 @@ version = 2
t.Fatal(err)
}

statusC, err := task.Wait(ctx)
if err != nil {
t.Fatal(err)
}

if err := task.Kill(ctx, syscall.SIGKILL); err != nil {
t.Fatal(err)
}

// Wait for task exit. If the task takes longer to exit, we risc
// wrongfully determining that the task has been restarted when we
// check the status in the for loop bellow and find that it's still
// running.
select {
case <-statusC:
case <-time.After(30 * time.Second):
}

begin := time.Now()
lastCheck := begin

Expand Down

0 comments on commit 39afc6f

Please sign in to comment.