Skip to content

Flaky test TestSourceDateEpoch on CI / Windows Integration (windows-2022, legacyCRI) #9090

@samuelkarp

Description

@samuelkarp

Seen during #9088

time="2023-09-13T01:07:30Z" level=warning msg="Invalid SOURCE_DATE_EPOCH" error="invalid SOURCE_DATE_EPOCH value: invalid value: strconv.ParseInt: parsing \"foo\": invalid syntax"
    epoch_test.go:110: 
        	Error Trace:	D:/a/containerd/containerd/src/github.com/containerd/containerd/pkg/epoch/epoch_test.go:110
        	Error:      	Should be true
        	Test:       	TestSourceDateEpoch/WithInvalidSourceDateEpoch
        	Messages:   	now: 2023-09-13 01:07:30.1079008 +0000 UTC, v: 2023-09-13 01:07:30.2645118 +0000 UTC
 	})

The failing line is

require.True(t, rightAfter(now, v), "now: %s, v: %s", now, v)

Maybe the timer resolution on Windows is a bit different from what we expect?

	threshold := 10 * time.Millisecond
	if runtime.GOOS == "windows" {
		// Low timer resolution on Windows
		threshold *= 10
	}
	return t2.After(t1) && t2.Before(t1.Add(threshold))

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