mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-08-24 02:24:25 -05:00
The integration test watchdog fails a test if its recording takes longer than 40 seconds. Under the race detector everything runs several times slower, so legitimately slow tests (e.g. a conflicting interactive rebase) blow that budget and fail even though nothing is actually stuck. Key the timeout off a build-tag constant: the `race` tag is set automatically when the binary is built with -race, so a race build gets a 5x-longer budget while a normal build is unchanged, and the two can't drift apart the way a runtime flag would. The base 40s stays in one place; only the multiplier varies by build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11 lines
427 B
Go
11 lines
427 B
Go
//go:build race
|
|
|
|
package gui
|
|
|
|
// The race detector makes everything run several times slower, so the
|
|
// recording watchdog needs a correspondingly longer timeout; otherwise it
|
|
// fires on tests that are merely slow under -race rather than actually stuck.
|
|
// The `race` build tag is set automatically when the binary is built with
|
|
// -race, so this can't drift out of sync with the actual build.
|
|
const testTimeoutMultiplier = 4
|