Skip to content

Commit 20fc372

Browse files
committed
fix ci
1 parent 1179472 commit 20fc372

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

‎internal/app/git_status_load_test.go‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,16 @@ func TestMissingGitDisablesPersistsAndRequiresValidPathToEnable(t *testing.T) {
4949
}
5050
v.submitGitReads(layout.Context{Now: time.Now()})
5151
waitGitLoaded(t, v, 0)
52-
select {
53-
case result := <-v.loader.results:
54-
v.acceptLoad(result) // The shared direct-settings save.
55-
case <-time.After(3 * time.Second):
56-
t.Fatal("automatic Git disable did not save")
52+
// A cancelled read from the other panel can arrive before the save result.
53+
deadline := time.NewTimer(3 * time.Second)
54+
defer deadline.Stop()
55+
for v.directSettingsSave != nil {
56+
select {
57+
case result := <-v.loader.results:
58+
v.acceptLoad(result)
59+
case <-deadline.C:
60+
t.Fatal("automatic Git disable did not save")
61+
}
5762
}
5863
loaded, err := settings.LoadAndRepair(data, catalogue)
5964
if err != nil {
@@ -70,10 +75,11 @@ func TestMissingGitDisablesPersistsAndRequiresValidPathToEnable(t *testing.T) {
7075
t.Fatal("disabled Git retained pending work or markers on another panel")
7176
}
7277
}
78+
readsBeforeNavigation := calls.Load()
7379
v.load(0, root, "")
7480
waitLoaded(t, v, 0)
7581
v.submitGitReads(layout.Context{Now: time.Now()})
76-
if calls.Load() != 1 || v.panels[0].gitRead != nil {
82+
if calls.Load() != readsBeforeNavigation || v.panels[0].gitRead != nil {
7783
t.Fatal("directory navigation retried the missing executable")
7884
}
7985
v.startSettingsWidget("programs.git")

0 commit comments

Comments
 (0)