From d1dc3a1888bd6e7f43bb42dcfe7faec2a4b6eaa7 Mon Sep 17 00:00:00 2001 From: Laurent Demailly Date: Wed, 2 Oct 2024 14:07:13 -0700 Subject: [PATCH 1/4] Use https://github.com/fortio/log/releases/tag/v1.17.1 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 5bbc813..e06975f 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.19 require ( fortio.org/assert v1.2.1 - fortio.org/log v1.16.0 + fortio.org/log v1.17.1 fortio.org/sets v1.2.0 github.com/fsnotify/fsnotify v1.7.0 golang.org/x/exp v0.0.0-20240604190554-fc45aab8b7f8 diff --git a/go.sum b/go.sum index d22cff2..ac86c07 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ fortio.org/assert v1.2.1 h1:48I39urpeDj65RP1KguF7akCjILNeu6vICiYMEysR7Q= fortio.org/assert v1.2.1/go.mod h1:039mG+/iYDPO8Ibx8TrNuJCm2T2SuhwRI3uL9nHTTls= -fortio.org/log v1.16.0 h1:GhU8/9NkYZmEIzvTN/DTMedDAStLJraWUUVUA2EbNDc= -fortio.org/log v1.16.0/go.mod h1:t58Spg9njjymvRioh5F6qKGSupEsnMjXLGWIS1i3khE= +fortio.org/log v1.17.1 h1:YQoGyZBnXTVIs77/nZw7BppwSOIamP3I092PGBenBZs= +fortio.org/log v1.17.1/go.mod h1:t58Spg9njjymvRioh5F6qKGSupEsnMjXLGWIS1i3khE= fortio.org/sets v1.2.0 h1:FBfC7R2xrOJtkcioUbY6WqEzdujuBoZRbSdp1fYF4Kk= fortio.org/sets v1.2.0/go.mod h1:J2BwIxNOLWsSU7IMZUg541kh3Au4JEKHrghVwXs68tE= fortio.org/struct2env v0.4.1 h1:rJludAMO5eBvpWplWEQNqoVDFZr4RWMQX7RUapgZyc0= From 6d3ae0461d573c78015a1a97b1c4fbf71804d06c Mon Sep 17 00:00:00 2001 From: Laurent Demailly Date: Wed, 2 Oct 2024 14:12:07 -0700 Subject: [PATCH 2/4] sleep some more... slow mac ci --- configmap/loglevel_change_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configmap/loglevel_change_test.go b/configmap/loglevel_change_test.go index 263a4dc..81df1de 100644 --- a/configmap/loglevel_change_test.go +++ b/configmap/loglevel_change_test.go @@ -76,7 +76,7 @@ func TestDynamicLogLevelAndBinaryFlag(t *testing.T) { t.Fatalf("unable to write %v: %v", fName, err) } // Time based tests aren't great, specially when ran on (slow) CI but... - time.Sleep(2 * time.Second) + time.Sleep(3 * time.Second) newLevel := log.GetLogLevel() if newLevel != log.Info { t.Errorf("Loglevel didn't change as expected, still %v %v", newLevel, newLevel.String()) @@ -89,7 +89,7 @@ func TestDynamicLogLevelAndBinaryFlag(t *testing.T) { if err = os.WriteFile(binaryFlag, []byte{1, 2, 3, 4, 5}, 0o644); err != nil { t.Fatalf("unable to write %v: %v", binaryFlag, err) } - time.Sleep(3 * time.Second) + time.Sleep(4 * time.Second) // We might get more than 1 event for some reasons, so more than 1 error errCount := u.Errors() if errCount < 1 { From 76647365a08eaba836f14e116a1b7569d2cdcfae Mon Sep 17 00:00:00 2001 From: Laurent Demailly Date: Wed, 2 Oct 2024 14:17:20 -0700 Subject: [PATCH 3/4] moar sleep --- configmap/loglevel_change_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configmap/loglevel_change_test.go b/configmap/loglevel_change_test.go index 81df1de..c6d4145 100644 --- a/configmap/loglevel_change_test.go +++ b/configmap/loglevel_change_test.go @@ -55,7 +55,7 @@ func TestDynamicLogLevelAndBinaryFlag(t *testing.T) { t.Fatalf("unable to write %v: %v", binaryFlag, err) } // Time based tests aren't great, specially when ran on (slow) CI try to have notification not get events for above. - time.Sleep(1 * time.Second) + time.Sleep(3 * time.Second) var u *configmap.Updater log.SetLogLevel(log.Debug) if u, err = configmap.Setup(flag.CommandLine, pDir); err != nil { @@ -76,7 +76,7 @@ func TestDynamicLogLevelAndBinaryFlag(t *testing.T) { t.Fatalf("unable to write %v: %v", fName, err) } // Time based tests aren't great, specially when ran on (slow) CI but... - time.Sleep(3 * time.Second) + time.Sleep(5 * time.Second) newLevel := log.GetLogLevel() if newLevel != log.Info { t.Errorf("Loglevel didn't change as expected, still %v %v", newLevel, newLevel.String()) From 7e1899e22506697cc806fbe50d5aa6aaa9256f07 Mon Sep 17 00:00:00 2001 From: Laurent Demailly Date: Wed, 2 Oct 2024 14:28:30 -0700 Subject: [PATCH 4/4] no /tmp on windows --- configmap/updater_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configmap/updater_test.go b/configmap/updater_test.go index d5376ae..b0a7322 100644 --- a/configmap/updater_test.go +++ b/configmap/updater_test.go @@ -37,7 +37,7 @@ type updaterTestSuite struct { func (s *updaterTestSuite) SetupTest() { var err error - s.tempDir, err = os.MkdirTemp("/tmp", "updater_test") + s.tempDir, err = os.MkdirTemp("", "updater_test") assert.NoError(s.T(), err, "failed creating temp directory for testing") s.copyTestDataToDir() s.linkDataDirTo(firstGoodDir)