From 78bb67fbf79bce6abed9d4e416ca1d10ed7dc12b Mon Sep 17 00:00:00 2001 From: Jason Cameron Date: Tue, 22 Apr 2025 20:31:19 -0400 Subject: fix: improve error handling and create the json encoder once #331 (#332) * fix: improve error handling for resource closing and JSON encoding in MakeChallenge * chore: update CHANGELOG with recent changes and improvements * refactor: simplify RenderIndex function and improve error handling --------- Signed-off-by: Jason Cameron --- internal/test/playwright_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/test') diff --git a/internal/test/playwright_test.go b/internal/test/playwright_test.go index 69652ce..8656f76 100644 --- a/internal/test/playwright_test.go +++ b/internal/test/playwright_test.go @@ -378,14 +378,14 @@ func pwFail(t *testing.T, page playwright.Page, format string, args ...any) erro } func pwTimeout(tc testCase, deadline time.Time) *float64 { - max := *playwrightMaxTime + maxTime := *playwrightMaxTime if tc.isHard { - max = *playwrightMaxHardTime + maxTime = *playwrightMaxHardTime } d := time.Until(deadline) - if d <= 0 || d > max { - return playwright.Float(float64(max.Milliseconds())) + if d <= 0 || d > maxTime { + return playwright.Float(float64(maxTime.Milliseconds())) } return playwright.Float(float64(d.Milliseconds())) } -- cgit v1.2.3