Skip to content

Flaky test: the vault setting in TestSettingsChangeAPreferenceAndAVaultSetting times out under the race detector #203

Closed

Description

@bketelsen

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:

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

  1. added
    bug
    on Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions