Skip to content

Commit cc4910b

Browse files
committed
Fix e2e checksum failure in testSyncDownloadPartial by deleting origin file/xattrs
1 parent f7bf995 commit cc4910b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

client/fed_long_test.go

+16
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import (
2828
"os"
2929
"path/filepath"
3030
"strconv"
31+
"strings"
3132
"testing"
3233
"time"
3334

@@ -810,6 +811,21 @@ func TestSyncDownload(t *testing.T) {
810811
require.NoError(t, err)
811812
require.Len(t, transferDetailsDownload, 1)
812813

814+
// After the introduction of E2E client checksumming, this test started to break on the final
815+
// direct read download. As best we can currently figure, this happens because the subsequent
816+
// DoPut call overwrites the file without overwriting the files xattrs, where the checksum is
817+
// stored. This causes the final directread DoGet to grab a file with a stale checksum. As a
818+
// workaround until this issue can be resolved in the upstream XRootD operation, we manually
819+
// delete the file from the Origin to force a rewrite of the xattrs checksum.
820+
var originLocation string
821+
for _, export := range fed.Exports {
822+
if strings.Contains(export.FederationPrefix, "/first/namespace") {
823+
originLocation = export.StoragePrefix
824+
break
825+
}
826+
}
827+
require.NoError(t, os.Remove(filepath.Join(originLocation, fmt.Sprintf("sync_download_partial/%s/%s/%s", dirName, filepath.Base(innerTempDir), filepath.Base(innerTempFile.Name())))))
828+
813829
// Change the contents of one already-uploaded file and re-upload it.
814830
// Filesize is the same so a re-download should be skipped.
815831
newTestFileContent := "XXXX content is within another XXXX"

0 commit comments

Comments
 (0)