Skip to content

Commit c9061b4

Browse files
Mixficsolwuxianrong
andauthored
fix ci
Co-authored-by: wuxianrong <[email protected]>
1 parent 1c8698b commit c9061b4

File tree

2 files changed

+2
-86
lines changed

2 files changed

+2
-86
lines changed

.github/workflows/pika.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
rm -rf ./deps
5151
rm -rf ./buildtrees
5252
53-
- uses: actions/upload-artifact@v3
53+
- uses: actions/upload-artifact@v4
5454
with:
5555
name: ${{ env.ARTIFACT_PIKA_NAME }}
5656
path: ${{ github.workspace }}/build/pika
@@ -221,7 +221,7 @@ jobs:
221221
with:
222222
images: pikadb/pika
223223

224-
- uses: actions/download-artifact@v3
224+
- uses: actions/download-artifact@v4
225225
with:
226226
name: ${{ env.ARTIFACT_PIKA_NAME }}
227227
path: artifact/

tests/integration/server_test.go

Lines changed: 0 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"strconv"
66
"strings"
77
"time"
8-
"os"
9-
"path/filepath"
108
. "github.com/bsm/ginkgo/v2"
119
. "github.com/bsm/gomega"
1210
"github.com/redis/go-redis/v9"
@@ -177,88 +175,6 @@ var _ = Describe("Server", func() {
177175
Expect(err).NotTo(HaveOccurred())
178176
Expect(val).To(ContainSubstring("Background append only file rewriting"))
179177
})
180-
181-
It("should BgSave", func() {
182-
res := client.Set(ctx, "bgsava_key1", "bgsava_value1", 0)
183-
Expect(res.Err()).NotTo(HaveOccurred())
184-
_ = client.Set(ctx, "bgsava_key2", "bgsava_value2", 0)
185-
Expect(res.Err()).NotTo(HaveOccurred())
186-
187-
lastSaveBefore, err := client.LastSave(ctx).Result()
188-
Expect(err).NotTo(HaveOccurred())
189-
190-
currentDir, err := os.Getwd()
191-
Expect(err).NotTo(HaveOccurred())
192-
193-
var pikaDir string
194-
for currentDir != "/" {
195-
if filepath.Base(currentDir) == "pika" {
196-
pikaDir = currentDir
197-
break
198-
}
199-
currentDir = filepath.Dir(currentDir)
200-
}
201-
Expect(pikaDir).NotTo(BeEmpty(), "Could not find 'pika' directory")
202-
203-
var dumpDirs []string
204-
err = filepath.WalkDir(pikaDir, func(path string, info os.DirEntry, err error) error {
205-
if err != nil {
206-
return err
207-
}
208-
if info.IsDir() && info.Name() == "dump" {
209-
absPath, err := filepath.Abs(path)
210-
if err != nil {
211-
return err
212-
}
213-
dumpDirs = append(dumpDirs, absPath)
214-
}
215-
return nil
216-
})
217-
Expect(err).NotTo(HaveOccurred(), "Error while searching for 'dump' directories")
218-
Expect(len(dumpDirs)).To(BeNumerically(">", 0), "No 'dump' directories found in 'pika'")
219-
220-
shortestDumpDir := dumpDirs[0]
221-
for _, dir := range dumpDirs {
222-
if len(dir) < len(shortestDumpDir) {
223-
shortestDumpDir = dir
224-
}
225-
}
226-
227-
dumpConfig := client.ConfigGet(ctx, "dump-path")
228-
Expect(dumpConfig.Err()).NotTo(HaveOccurred())
229-
originalDumpPath, ok := dumpConfig.Val()["dump-path"]
230-
Expect(ok).To(BeTrue())
231-
232-
dumpPath := filepath.Join(filepath.Dir(shortestDumpDir), originalDumpPath)
233-
234-
res2, err2 := client.BgSave(ctx).Result()
235-
Expect(err2).NotTo(HaveOccurred())
236-
Expect(res.Err()).NotTo(HaveOccurred())
237-
Expect(res2).To(ContainSubstring("Background saving started"))
238-
239-
startTime := time.Now()
240-
maxWaitTime := 10 * time.Second
241-
242-
for {
243-
lastSaveAfter, err := client.LastSave(ctx).Result()
244-
Expect(err).NotTo(HaveOccurred())
245-
246-
if lastSaveAfter > lastSaveBefore {
247-
break
248-
}
249-
250-
if time.Since(startTime) > maxWaitTime {
251-
Fail("BGSAVE did not complete within the expected time")
252-
}
253-
254-
time.Sleep(500 * time.Millisecond)
255-
}
256-
257-
258-
files, err := os.ReadDir(dumpPath)
259-
Expect(err).NotTo(HaveOccurred(), "Failed to read dump_path")
260-
Expect(len(files)).To(BeNumerically(">", 0), "dump_tmp directory is empty, BGSAVE failed to create a file")
261-
})
262178

263179
It("should FlushDb", func() {
264180
res := client.Do(ctx, "flushdb")

0 commit comments

Comments
 (0)