From 5cc7479e0ec296fc8abf7dfa632597e888f35cbd Mon Sep 17 00:00:00 2001 From: Sarah French <15078782+SarahFrench@users.noreply.github.com> Date: Tue, 13 May 2025 16:53:41 +0100 Subject: [PATCH] Update test to tolerate durations in scientific notation (very short test durations) (#37041) It's not valid to force integer values for `time`, so this is a case where the test needs to be updated and not the code under test. --- internal/command/test_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/command/test_test.go b/internal/command/test_test.go index d52fb192f3..d3ec9f0552 100644 --- a/internal/command/test_test.go +++ b/internal/command/test_test.go @@ -3463,7 +3463,7 @@ func TestTest_JUnitOutput(t *testing.T) { } // actual output will include timestamps and test duration data, which isn't deterministic; redact it for comparison - timeRegexp := regexp.MustCompile(`time=\"[0-9\.]+\"`) + timeRegexp := regexp.MustCompile(`time="[^"]+"`) actualOut = timeRegexp.ReplaceAll(actualOut, []byte("time=\"TIME_REDACTED\"")) timestampRegexp := regexp.MustCompile(`timestamp="[^"]+"`) actualOut = timestampRegexp.ReplaceAll(actualOut, []byte("timestamp=\"TIMESTAMP_REDACTED\""))