You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flaky test: the vault setting in TestSettingsChangeAPreferenceAndAVaultSetting times out under the race detector #203
TestSettingsChangeAPreferenceAndAVaultSetting (internal/desktop/window/window_test.go) fails now and then in CI's Race detector job with timed out waiting for the vault's setting.
Where it failed:
main at 6458058 (run 43088122985): --- FAIL: TestSettingsChangeAPreferenceAndAVaultSetting (10.57s)
Why it is close to the limit: the test changes vault:dailyFolder through settingChanged and waits with f.until, which is desktoptest.Loop.Until and gives up after 10 seconds (desktoptest.go). Under go test -race on a desktop it already takes about 4.8s when it passes (4.76s on main, 4.80s on #202's branch, measured with -race -count=1 on ./internal/desktop/window/). Almost all of that is the round trip of vault.configure through notesd until a.settings.DailyFolder reads back "Journal". On a slower CI runner, with the other packages' race tests running beside it, that passes 10 seconds.
What's wanted: a test that cannot time out on a slow runner while the app is correct. Either:
find what makes the vault setting's round trip take seconds (a debounce, a re-read of the vault's settings, or a wait in notesd) and make the test independent of it; or
give this one wait a limit sized for the race detector with f.loop.UntilWithin, with a comment saying why.
The first is better if the delay is a fixed wait the test can shorten; the second if the round trip is honest work.
Found while checking #202's CI, which this does not block: the failure is the same on main.
Activity