Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix archiver test - inconsistent number of files #3902

Merged
merged 2 commits into from
Sep 25, 2023
Merged
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
8 changes: 6 additions & 2 deletions archiver/archiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"os"
"strconv"
"strings"
"sync/atomic"
"testing"
"time"
Expand All @@ -22,6 +23,7 @@ import (
"github.com/rudderlabs/rudder-go-kit/bytesize"
"github.com/rudderlabs/rudder-go-kit/filemanager"
"github.com/rudderlabs/rudder-go-kit/testhelper/docker/resource"
trand "github.com/rudderlabs/rudder-go-kit/testhelper/rand"
backendconfig "github.com/rudderlabs/rudder-server/backend-config"
"github.com/rudderlabs/rudder-server/jobsdb"
"github.com/rudderlabs/rudder-server/utils/misc"
Expand All @@ -32,7 +34,7 @@ import (

func TestJobsArchival(t *testing.T) {
var (
prefix = "some-prefix"
prefix = trand.String(10)
minioResource []*destination.MINIOResource

// test data - contains jobs from 3 workspaces(1 - 1 source, 2 & 3 - 2 sources each)
Expand Down Expand Up @@ -171,7 +173,9 @@ func TestJobsArchival(t *testing.T) {
fileIter := fm.ListFilesWithPrefix(context.Background(), "", prefix, 20)
files, err := getAllFileNames(fileIter)
require.NoError(t, err)
require.Equal(t, sourcesPerWorkspace[i], len(files))
require.Equal(t, sourcesPerWorkspace[i], len(files),
fmt.Sprintf("found files: %s for workspace: %s", strings.Join(files, ", "), workspace),
)

for j, file := range files {
downloadFile, err := os.CreateTemp(t.TempDir(), fmt.Sprintf("backedupfile%d%d", i, j))
Expand Down
Loading