Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

fix(tests): 32-bit build of EC e2e tests, type-check linux/386 in CI (#9922)

Chris Lu3eb550a3f1f4
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index 334e75ca0e..91429fea9a 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -37,6 +37,21 @@ jobs:
# Fail only if there are actual vet errors (not counting the filtered lock warnings)
if grep -q "vet:" vet-output.txt; then exit 1; fi
+ vet-32bit:
+ name: Go Vet 32-bit
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check out code into the Go module directory
+ uses: actions/checkout@v6
+ - name: Set up Go
+ uses: actions/setup-go@v6
+ with:
+ go-version-file: 'go.mod'
+ - name: Go Vet linux/386 (type-checks code and tests for 32-bit int overflows)
+ run: |
+ GOOS=linux GOARCH=386 go vet ./... 2>&1 | grep -v "MessageState contains sync.Mutex" | grep -v "IdentityAccessManagement contains sync.RWMutex" | tee vet-32bit-output.txt
+ if grep -q "vet:" vet-32bit-output.txt; then exit 1; fi
+
build:
name: Build
runs-on: ubuntu-latest
diff --git a/test/s3/s3client/s3client.go b/test/s3/s3client/s3client.go
index 0179ad27c8..79f1590922 100644
--- a/test/s3/s3client/s3client.go
+++ b/test/s3/s3client/s3client.go
@@ -23,7 +23,7 @@ func main() {
Name: "newbucket",
Versioning: false,
},
- MaxBackoffDelay: aws.Int(int(time.Second * 5)),
+ MaxBackoffDelay: aws.Int(int((5 * time.Second).Milliseconds())),
MaxRetryAttempts: aws.Int(1),
}
@@ -77,7 +77,7 @@ func MyAwsConfig(cfg MyConfig) (*aws.Config, error) {
config.WithEndpointResolverWithOptions(customResolver),
config.WithRetryer(func() aws.Retryer {
r := retry.AddWithMaxAttempts(retry.NewStandard(), *cfg.MaxRetryAttempts)
- return retry.AddWithMaxBackoffDelay(r, time.Duration(*cfg.MaxBackoffDelay*1000*1000))
+ return retry.AddWithMaxBackoffDelay(r, time.Duration(*cfg.MaxBackoffDelay)*time.Millisecond)
}))
return &awsCfg, err
}
diff --git a/weed/worker/tasks/erasure_coding/ec_task_encode_files_e2e_test.go b/weed/worker/tasks/erasure_coding/ec_task_encode_files_e2e_test.go
index f33e6713cb..66632a09b4 100644
--- a/weed/worker/tasks/erasure_coding/ec_task_encode_files_e2e_test.go
+++ b/weed/worker/tasks/erasure_coding/ec_task_encode_files_e2e_test.go
@@ -51,7 +51,7 @@ func TestEcEncodeLeavesRightFilesAndRemovesStubAndSource(t *testing.T) {
framework.AllocateVolume(t, clientA, volumeID, collection)
httpClient := framework.NewHTTPClient()
for i := 0; i < 8; i++ {
- fid := framework.NewFileID(volumeID, uint64(948000+i), uint32(0x9490CA00+i))
+ fid := framework.NewFileID(volumeID, uint64(948000+i), 0x9490CA00+uint32(i))
payload := make([]byte, 4096)
for j := range payload {
payload[j] = byte(i + 1)
diff --git a/weed/worker/tasks/erasure_coding/ec_task_julor_layout_e2e_test.go b/weed/worker/tasks/erasure_coding/ec_task_julor_layout_e2e_test.go
index 854cb0b4d1..f543f01344 100644
--- a/weed/worker/tasks/erasure_coding/ec_task_julor_layout_e2e_test.go
+++ b/weed/worker/tasks/erasure_coding/ec_task_julor_layout_e2e_test.go
@@ -66,7 +66,7 @@ func TestEcEncodeJulorLayoutConverges(t *testing.T) {
framework.AllocateVolume(t, clients[srcServer], volumeID, collection)
httpClient := framework.NewHTTPClient()
for i := 0; i < 8; i++ {
- fid := framework.NewFileID(volumeID, uint64(950000+i), uint32(0x9500CA00+i))
+ fid := framework.NewFileID(volumeID, uint64(950000+i), 0x9500CA00+uint32(i))
payload := make([]byte, 4096)
for j := range payload {
payload[j] = byte(i + 1)