DEV Community

Jota Feldmann
Jota Feldmann

Posted on

2 1

Uncached Go tests: avoid flaky tests

So, crazy about your integration tests with Go?

I was totally crazy testing my endpoints, and, for hours, I didn't know why some tests were flaky in my CI environment.

But since Go 1.10 tests are cached.

To avoid cache, you can use:

go test -count=1

Thanks @marciorodrigues and that issue.

Top comments (0)

AWS Q Developer image

Your AI Code Assistant

Generate and update README files, create data-flow diagrams, and keep your project fully documented. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE