The usual causes are real time, randomness, shared state, and timing between goroutines. Flaky tests teach people to ignore red builds, so they are worth fixing early, for example by injecting a clock.