Skip to content

Make slow stdlib tests faster. #1327

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

Merged
merged 1 commit into from
Jul 23, 2024

Conversation

nevkontakte
Copy link
Member

The main improvement here applies to crypto/internal/edwards25519/..., which use testing/quick for fuzz-style tests. Because those tests rely heavily on 64-bit math, they are much, much slower under GopherJS than upstream.

I added a hook into testing/quick that allows us to cap the number of iterations a test would be allowed to execute. Although that does technically reduce coverage, it's better than disabling the test entirely and we don't change any logic in those packages in the first place.

I deleted some overlays that corresponded to the old location of the same packages, the changes in this commit serve the same purpose.

I also shortened a couple of tests in image/gif and crypto/x509, for the same reasons.

The main improvement here applies to crypto/internal/edwards25519/...,
which use testing/quick for fuzz-style tests. Because those tests rely
heavily on 64-bit math, they are much, much slower under GopherJS than
upstream.

I added a hook into testing/quick that allows us to cap the number of
iterations a test would be allowed to execute. Although that does
technically reduce coverage, it's better than disabling the test
entirely and we don't change any logic in those packages in the first
place.

I deleted some overlays that corresponded to the old location of the
same packages, the changes in this commit serve the same purpose.

I also shortened a couple of tests in image/gif and crypto/x509, for the
same reasons.
@nevkontakte nevkontakte requested a review from flimzy July 19, 2024 22:47
@nevkontakte nevkontakte enabled auto-merge July 20, 2024 19:30
@grantnelson-wf
Copy link
Collaborator

FWIW, it looks great to me.

@nevkontakte nevkontakte merged commit d07fd61 into gopherjs:master Jul 23, 2024
10 checks passed
@nevkontakte nevkontakte deleted the quicker-tests branch July 23, 2024 13:35
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

Successfully merging this pull request may close these issues.

3 participants