-
Notifications
You must be signed in to change notification settings - Fork 794
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
CI: parallize unit tests #5954
CI: parallize unit tests #5954
Conversation
47f4ea4
to
7dd8114
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you are reverting the integration test changes.
7dd8114
to
36f2888
Compare
Yes did it by mistake fixed it. |
5693588
to
8d1e570
Compare
Following tests are not parallel and are racing when using
|
They do not seem to benefit much from more cores/memory so you likely need to look at other options or get them to run parallel much better. I guess the early spikes are when we we compile the go code in the ci setup. Maybe also worth looking into. It is not clear to me if we would actually need to compile anything else for the unit test. The other thing could be is to split the unit-test target in three separate ones and then run them in parallel.
|
4d4cb56
to
845f109
Compare
Wow @Luap99 !!! unit test without |
845f109
to
6aea70d
Compare
Looks like removing |
@nalind Any objections to removing |
Other than that I'll probably forget to run them that way from time to time if it isn't automated, which isn't that important, no. |
6aea70d
to
6ba924d
Compare
Also it looks like |
Come to think of it, can we conditionally keep that for the scheduled "cron" builds? I don't think anyone actually waits for them to finish. |
Sounds good to me, is there any way to test that when I open a PR or it will only run on merge ? I will open a separate PR to add |
None of the packit tests enforce anything, just ignore them for now.
That is easy to do sure except nobody looks at these results so that is pretty pointless. How imporant is -race really, did you ever catch actual issues with it?
Well anything post merge cannot be tested on a PR and this is not a github workflow. This must be done in cirrus.yml and would be easy, just check if the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Total CI time reported by cirrus 38:01
That seems quite good, vfs is noticeably slower though which I guess is expected to the higher amount of io required for it. |
@nalind @TomSweeneyRedHat @rhatdan PTAL, if consensus is made for |
// which eventually and indirectly accesses a global variable | ||
// defined in `go-selinux`, this must be fixed at `go-selinux` | ||
// or builder must enable sometime of locking mechanism i.e if | ||
// routine is creating Builder other's must wait for it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How will we know when it's safe? Is there an open issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just created an issue #5967 and added in comment
and commit
message.
Anecdata: I do read the ones for buildah. |
Ok if you actual can make use of the data then sure let's do that. I just have never seen anyone respond to these emails or post PRs to fix the issues from there. Maybe that just wasn't necessary on buildah so far and/or I don't look at buildah PRs often enough. |
6000bd1
to
ae100a5
Compare
ae100a5
to
752df31
Compare
@@ -25,8 +25,7 @@ GO_GCFLAGS := $(shell if $(GO) version|grep -q gccgo; then echo "-gccgoflags"; e | |||
NPROCS := $(shell nproc) | |||
export GO_BUILD=$(GO) build | |||
export GO_TEST=$(GO) test -parallel=$(NPROCS) | |||
#RACEFLAGS := $(shell $(GO_TEST) -race ./pkg/dummy > /dev/null 2>&1 && echo -race) | |||
RACEFLAGS := | |||
RACEFLAGS ?= $(shell $(GO_TEST) -race ./pkg/dummy > /dev/null 2>&1 && echo -race) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you merge this one with previous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
LGTM |
Add `t.Parallel()` to unit tests whereever its possible without race. Signed-off-by: flouthoc <[email protected]>
Signed-off-by: flouthoc <[email protected]>
Signed-off-by: flouthoc <[email protected]>
See issue: containers#5967 Signed-off-by: flouthoc <[email protected]>
752df31
to
7102793
Compare
contrib/cirrus/test.sh
Outdated
@@ -67,7 +67,13 @@ else | |||
showrun make validate | |||
;; | |||
unit) | |||
showrun make test-unit | |||
race= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, line indentation still seems wrong, looks like you use one tab and spaces on that line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
Signed-off-by: flouthoc <[email protected]>
7102793
to
147a3ca
Compare
Ephemeral COPR build failed. @containers/packit-build please check. |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: flouthoc, Luap99, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
d5ed8b4
into
containers:main
Just to confirm post merge tests did run with -race so this works correctly. |
What type of PR is this?
What this PR does / why we need it:
How to verify it
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?