Skip to content

testdata: attempt to deflake goroutines test#5384

Merged
deadprogram merged 1 commit into
tinygo-org:devfrom
jakebailey:fix-flaky-tests
Jul 24, 2026
Merged

testdata: attempt to deflake goroutines test#5384
deadprogram merged 1 commit into
tinygo-org:devfrom
jakebailey:fix-flaky-tests

Conversation

@jakebailey

@jakebailey jakebailey commented May 11, 2026

Copy link
Copy Markdown
Member

Fixes #4965

I got tired of hitting this flake locally and in CI. This change seems to make it pass, but it's a little unclear without more eyes whether or not I have defeated the purpose of this test somehow as I of course arrived here after this was committed...

@deadprogram

Copy link
Copy Markdown
Member

I also find those failures very annoying. The tests are not so precise as to preclude these changes. Anyone have any objections for me to squash/merge?

@aykevl

aykevl commented May 27, 2026

Copy link
Copy Markdown
Member

This kinda does defeat the original purpose of these tests. I wrote them a long time ago to show that TinyGo worked concurrently.

What about only running this test on systems without thread support? I don't think they're flaky there.

@deadprogram

Copy link
Copy Markdown
Member

I think perhaps now that I have increased the runner sizes this should be less of a problem for the CI.

@jakebailey

Copy link
Copy Markdown
Member Author

I hit this frequently when doing local testing, so I don't think increasing a builder size really fixes it...

@jakebailey

Copy link
Copy Markdown
Member Author

What about only running this test on systems without thread support? I don't think they're flaky there.

Pushed that, at least

@deadprogram

Copy link
Copy Markdown
Member

@jakebailey can you please rebase against the latest dev to rerun the tests? Thank you.

@aykevl aykevl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. @deadprogram any thoughts?

Comment thread main_test.go Outdated
@deadprogram

Copy link
Copy Markdown
Member

Do we actually still need this? I think some recent changes such as #5487 have addressed the core problem.

@jakebailey

Copy link
Copy Markdown
Member Author

If that worked, then we can close this and the two other issues.

@jakebailey jakebailey closed this Jul 8, 2026
@jakebailey jakebailey reopened this Jul 8, 2026
@jakebailey

Copy link
Copy Markdown
Member Author

Er, well, the part that works on #4965 is still relevant, but the timer stuff might not be?

@jakebailey

Copy link
Copy Markdown
Member Author

Going to close this for now, I have not seen a race in a while; maybe the goroutine one is still around but I haven't seen it either.

Maybe both issues can be closed?

@jakebailey jakebailey closed this Jul 22, 2026
@jakebailey
jakebailey deleted the fix-flaky-tests branch July 22, 2026 13:46
@jakebailey
jakebailey restored the fix-flaky-tests branch July 24, 2026 04:34
@jakebailey

Copy link
Copy Markdown
Member Author

Just hit goroutines again, sadly:

1m 15s
1m 36s
Run go test -tags=llvm15 -short -skip=TestErrors
no Go files in /home/runner/work/tinygo/tinygo/tests/testing
--- FAIL: TestBuild (0.00s)
    --- FAIL: TestBuild/Host (0.00s)
        --- FAIL: TestBuild/Host/goroutines.go (2.90s)
            main_test.go:377: output did not match (expected 523 bytes, got 523 bytes):
            main_test.go:377: diff expected actual
                --- expected
                +++ actual
                @@ -10,8 +10,8 @@
                   wait end
                 end waiting
                 value produced after some time: 42
                -non-blocking goroutine
                 done with non-blocking goroutine
                +non-blocking goroutine
                 async interface method call
                 slept inside func pointer 8
                 slept inside closure, with value: 20 8
                

@jakebailey jakebailey reopened this Jul 24, 2026
@jakebailey jakebailey changed the title testdata: attempt to deflake timers/goroutines tests testdata: attempt to deflake goroutines test Jul 24, 2026
@deadprogram

Copy link
Copy Markdown
Member

Thanks @jakebailey now merging.

@deadprogram
deadprogram merged commit 7756941 into tinygo-org:dev Jul 24, 2026
20 checks passed
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.

goroutines.go may be flaky

3 participants