-
-
Notifications
You must be signed in to change notification settings - Fork 660
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
Ignored Ordered
flag
#1198
Comments
hey thanks for reporting this with the clear reproducer. it almost certainly is due to this commit: that was introduced in 2.7.0 to solve the issue of non-deterministic order when specs are generated by iterating over a map. i tried to be careful around not breaking the explicit order of |
…specs are generated by a helper function fixes a subtle bug described in #1198 - the sort order in Ordering.go was not generating a consistent order for Ordered specs generated by helper functions
alrighty - can you try the latest commit on master with your original code? I've identified the issue (it's quite subtle, but Ginkgo was not sorting specs in Ordered containers correctly when there were multiple Ordered containers). Things should be working now. One other thing. As written, if one of your tests fails, you'll have to go by the name of the test to figure out which one failed. Ideally it would be possible to associate the outermost You can actually do this using func OrderedRun(description string) {
GinkgoHelper()
Describe(description, Ordered, func() {
...
})
} this actually resolves the bug you've discovered as well! As it now generates a different line number for each outer (The bug is still real, and I should have fixed it now... and will cut a release once I hear back from you - but just wanted to point out that |
I've pulled the latest master branch I didn't use the
I cannot thank you enough for the fix, sir! For me and for my open-source-ish problems, this is literally the interaction of the year! 🎺 🎺 |
hey @jabielecki - glad that worked for you. Thanks for the super clear reproduction steps, that certainly made this much much easier to debug and fix. I'll cut a release momentarily. |
alrighty 2.9.5 is out with this fix. |
Reproduction:
ginkgo_test.go
with:go run ./ginkgo --seed 42 -v .
This executes "a04" before "a03".
I expected that "a03" should be before "a04".
This is not merely an output artifact. With some
sync.Once
or evenBy()
it's easily verified that the code is in fact executed in a non-Ordered manner.These steps also reproduce on ginkgo v2.8.4. The v2.6.1 seems fine.
I've tried to make it even more minimal, but was unable to figure out how. The weird nesting of functions and containers seems to be relevant here.
The text was updated successfully, but these errors were encountered: