Skip to content

Conversation

@miparnisari
Copy link
Contributor

@miparnisari miparnisari commented Oct 3, 2025

Fixes a flaky test on my Windows machine that apparently is too slow 😆

C:\Users\mparn\Documents\GitHub\zed (main -> origin)
λ go test -race -count=1 ./...
?       github.com/authzed/zed/cmd/zed  [no test files]
ok      github.com/authzed/zed/internal/client  1.623s
--- FAIL: TestValidate (0.00s)
    --- FAIL: TestValidate/assertions_fail (0.01s)
        validate_test.go:329:
                Error Trace:    C:/Users/mparn/Documents/GitHub/zed/internal/cmd/validate_test.go:329
                Error:          Not equal:
                                expected: "error: parse error in `document:1#viewer@user:maria`, line 11, column 7: Expected relation or permission document:1#viewer@user:maria to exist           \n  8 |   }\n  9 | assertions:\n 10 |   assertTrue:\n 11 >     - \"document:1#viewer@user:maria\"\n    >        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~\n 12 | \n\n  Explanation:\n  ⨉ document:1 viewer (Xs)\n  └── ⨉ document:1 view (Xs)\n  \n\n\n"
                                actual  : "error: parse error in `document:1#viewer@user:maria`, line 11, column 7: Expected relation or permission document:1#viewer@user:maria to exist           \n  8 |   }\n  9 | assertions:\n 10 |   assertTrue:\n 11 >     - \"document:1#viewer@user:maria\"\n    >        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~\n 12 | \n\n  Explanation:\n  ⨉ document:1 viewer (0s)\n  └── ⨉ document:1 view (0s)\n  \n\n\n"

                                Diff:
                                --- Expected
                                +++ Actual
                                @@ -9,4 +9,4 @@
                                   Explanation:
                                -document:1 viewer (Xs)
                                -  └── ⨉ document:1 view (Xs)
                                +document:1 viewer (0s)
                                +  └── ⨉ document:1 view (0s)

                Test:           TestValidate/assertions_fail
FAIL
FAIL    github.com/authzed/zed/internal/cmd     4.650s

@miparnisari miparnisari marked this pull request as ready for review October 3, 2025 18:43
@miparnisari miparnisari enabled auto-merge October 3, 2025 18:54
Copy link
Contributor

@tstirrat15 tstirrat15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

}

var durationRegex = regexp.MustCompile(`\([\d.]*[µmn]s\)`)
var durationRegex = regexp.MustCompile(`\([\d.]*[µmn]?s\)`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this fix it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miparnisari miparnisari merged commit ce26ba6 into main Oct 6, 2025
11 checks passed
@miparnisari miparnisari deleted the fix-flaky-testValidate branch October 6, 2025 15:39
@github-actions github-actions bot locked and limited conversation to collaborators Oct 6, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants