8000 It should be possible to (roughly) prioritize tests. · Issue #1541 · onsi/ginkgo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

It should be possible to (roughly) prioritize tests. #1541

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

Open
onsi opened this issue Apr 2, 2025 · 0 comments
Open

It should be possible to (roughly) prioritize tests. #1541

onsi opened this issue Apr 2, 2025 · 0 comments

Comments

@onsi
Copy link
Owner
onsi commented Apr 2, 2025

By default, Ginkgo treats all tests equally. Ish. Tests decorated with Serial are guaranteed to run at the end of a parallel suite - after all the parallel tests have ended. But aside from that, ginkgo -randomize-all -p will interleave all specs and run them in parallel.

There are cases where this behavior is suboptimal. For example, in a parallelized suite known to have very some slow expensive tests it generally works better to run the slower tests sooner in the process to ensure they are parallelized wrt other tests than to wait till the end and effectively reduce the parallelization of the suite (think "boulders first, then sand").

To support this we could introduce a new Priority(int) decorator that takes an integer. By default all specs have priority 0. By annotating jobs with Priority(N) with N>0 we could then nudge Ginkgo's spec sorter to group specs by priority first then randomize them.

With -randomize-all this is straightforward. Without -randomize-all the specs are grouped by outer container. In this case the priority of the group will be the priority of the highest priority spec in the group. This will also apply to Ordered containers which are always treated as a group even with -randomize-all.

When Priority is defined on both a parent container and a child the innermost Prioirty will win.

/cc @pohly wdyt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0