fork of https://github.com/sourcegraph/zoekt
0

Configure Feed

Select the types of activity you want to include in your feed.

build: retry mutating metadata file in test

There is flakiness on GitHub CI. I can't reproduce locally on my linux
system. If this doesn't fix it, maybe it has something to do with the FS
used on GitHub. Will disable the test on CI then.

+19 -17
+19 -17
build/e2e_test.go
··· 96 96 } 97 97 98 98 t.Run("meta file", func(t *testing.T) { 99 - // Add a .meta file for each shard with repo.Name set to "repo-mutated" 100 - for _, p := range fs { 101 - repo, _, err := zoekt.ReadMetadataPath(p) 102 - if err != nil { 103 - t.Fatal(err) 104 - } 105 - repo.Name = "repo-mutated" 106 - b, err := json.Marshal(repo) 107 - if err != nil { 108 - t.Fatal(err) 109 - } 110 - 111 - if err := ioutil.WriteFile(p+".meta", b, 0600); err != nil { 112 - t.Fatal(err) 113 - } 114 - } 115 - 116 99 // use retryTest to allow for the directory watcher to notice the meta 117 100 // file 118 101 retryTest(t, func(fatalf func(format string, args ...interface{})) { 102 + // Add a .meta file for each shard with repo.Name set to 103 + // "repo-mutated". We do this inside retry helper since we have noticed 104 + // some flakiness on github CI. 105 + for _, p := range fs { 106 + repo, _, err := zoekt.ReadMetadataPath(p) 107 + if err != nil { 108 + t.Fatal(err) 109 + } 110 + repo.Name = "repo-mutated" 111 + b, err := json.Marshal(repo) 112 + if err != nil { 113 + t.Fatal(err) 114 + } 115 + 116 + if err := ioutil.WriteFile(p+".meta", b, 0600); err != nil { 117 + t.Fatal(err) 118 + } 119 + } 120 + 119 121 result, err := ss.Search(ctx, q, &sOpts) 120 122 if err != nil { 121 123 fatalf("Search(%v): %v", q, err)