Skip to content

Commit

Permalink
debug the path of bgsave
Browse files Browse the repository at this point in the history
  • Loading branch information
tsinow committed Sep 19, 2024
1 parent 51915b8 commit b21137c
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/integration/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"time"
"os"
"fmt"
. "github.com/bsm/ginkgo/v2"
. "github.com/bsm/gomega"
"github.com/redis/go-redis/v9"
Expand Down Expand Up @@ -196,6 +197,22 @@ var _ = Describe("Server", func() {
Expect(dumpConfig.Err()).NotTo(HaveOccurred())
dumpPath, ok := dumpConfig.Val()["dump-path"]
Expect(ok).To(BeTrue())

currentDir, err := os.Getwd()
Expect(err).NotTo(HaveOccurred())
fmt.Printf("Current working directory: %s\n", currentDir)

fmt.Printf("Dump path: %s\n", dumpPath)

// Check if dumpPath exists and is a directory
info, err := os.Stat(dumpPath)
if os.IsNotExist(err) {
Fail("Directory does not exist: " + dumpPath)
} else if err != nil {
Fail("Error accessing directory: " + err.Error())
}
Expect(info.IsDir()).To(BeTrue(), "dump path should be a directory")

files, err := os.ReadDir(dumpPath)
Expect(err).NotTo(HaveOccurred())
//need to delete test bgsave file?
Expand Down

0 comments on commit b21137c

Please sign in to comment.