Skip to content
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

Increase test timeout to 1s #168

Merged
merged 1 commit into from
Jun 27, 2024
Merged

Conversation

benjaminpjones
Copy link
Contributor

I noticed on #167 the GobanSVG onTap tests were flaky due to timeout. The SVG tests usually complete in <50ms, but one onTap test jumps over the 200ms threshold on occasion.

While the SVG tests run noticeably slower than Canvas tests (1-10ms vs 20-50ms on average), I wasn't able to determine whether there is a real perf issue. At any rate, I think it's reasonable to increase the timeout parameter since Jest's default is a whopping 5s.

Test Plan

I stress tested with this command:

for i in {1..10}; do yarn test || {echo "Failed after $i attempts" && break}; done

10 runs is more than enough to trigger the timeout at 200 ms, but we get no timeouts at the 1s threshold.

Alternative considered

We could alternatively increase timeout on a per-test basis. This would be fine too IMO, just takes more thought about which tests need it.

@anoek
Copy link
Member

anoek commented Jun 27, 2024

👍 thanks!

@anoek anoek merged commit 4d74948 into online-go:main Jun 27, 2024
1 check passed
@benjaminpjones benjaminpjones deleted the test-timeout branch June 27, 2024 11:32
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.

2 participants