Skip to content

Commit

Permalink
chore: fix archiver test - inconsistent number of files (#3902)
Browse files Browse the repository at this point in the history
edited test logs to help debug.
Re: files uploaded per source in archiver_test
  • Loading branch information
Sidddddarth authored Sep 25, 2023
1 parent 1c4fc5e commit 01a0737
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit 01a0737

Please sign in to comment.