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

fix: correct flaky test (TestLauncher_PIDFile_Locked) #25490

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions cmd/influxd/launcher/launcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
nethttp "net/http"
"os"
"path/filepath"
"runtime"
"strconv"
"testing"
"time"
Expand Down Expand Up @@ -219,11 +218,11 @@ func TestLauncher_PIDFile_Locked(t *testing.T) {
curSt, err := os.Stat(pidFilename)
require.NoError(t, err)

// CircleCI test runners for darwin don't have `noatime` / `relatime`, so
// the atime will differ, which is inside the system specific data.
if runtime.GOOS != "darwin" {
require.Equal(t, origSt, curSt)
}
// We can't compare origSt and curSt directly because even on mounts
// with "noatime" or "relatime" options, the sys.Atim field can still
// change. We'll just compare the most relevant exposed fields.
require.Equal(t, origSt.ModTime(), curSt.ModTime())
require.Equal(t, origSt.Mode(), curSt.Mode())
}()

require.ErrorIs(t, err, launcher.ErrPIDFileExists)
Expand Down