[Windows][Integration] Enable TestRestartMonitor

With the release of hcsshim v0.9.2, this test should pass without
issues on Windows.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2022-02-04 17:27:14 +02:00
parent 4f5ce5615a
commit b63000c65d
No known key found for this signature in database
GPG Key ID: 7D073DCC2C074CB5

View File

@ -125,13 +125,6 @@ func newDaemonWithConfig(t *testing.T, configTOML string) (*Client, *daemon, fun
// TestRestartMonitor tests restarting containers // TestRestartMonitor tests restarting containers
// with the restart monitor service plugin // with the restart monitor service plugin
func TestRestartMonitor(t *testing.T) { 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 ( const (
interval = 10 * time.Second interval = 10 * time.Second
epsilon = 1 * time.Second epsilon = 1 * time.Second
@ -188,10 +181,24 @@ version = 2
t.Fatal(err) t.Fatal(err)
} }
statusC, err := task.Wait(ctx)
if err != nil {
t.Fatal(err)
}
if err := task.Kill(ctx, syscall.SIGKILL); err != nil { if err := task.Kill(ctx, syscall.SIGKILL); err != nil {
t.Fatal(err) 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() begin := time.Now()
lastCheck := begin lastCheck := begin