Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions internal/presets/index_nowait_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,15 @@ New Game:
if err := os.Chtimes(yamlPath, downloaded, downloaded); err != nil {
t.Fatal(err)
}
// Force the rebuild to remain in progress for this assertion. On a fast
// runner it can otherwise finish before the nonblocking read returns,
// which is valid production behaviour and makes this test intermittent.
release, builds := slowBuilds(t, sc)
if got := sc.loadManifestIndexNoWait(); len(got) != 0 {
t.Fatalf("got %+v, want nothing until the index is built", got)
}
waitUntil(t, "the background rebuild to start", func() bool { return builds.Load() > 0 })
release()
deadline := time.Now().Add(30 * time.Second)
for {
if _, err := os.Stat(indexPath); err == nil {
Expand Down
Loading