Skip to content

Commit 01c257f

Browse files
authored
Decrease ChunkSize for GCS uploads (#481)
1 parent a334720 commit 01c257f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

integration_test/gce-testing-internal/gce/gce_testing.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,11 @@ func UploadContent(ctx context.Context, logger *log.Logger, vm *VM, content io.R
924924
}()
925925
object := storageClient.Bucket(transfersBucket).Object(path.Join(vm.Name, remotePath))
926926
writer := object.NewWriter(ctx)
927+
// We mainly use UploadContent for scripts, which are small relative to the
928+
// default ChunkSize of 16 MB.
929+
// Making ChunkSize smaller helps with heap pressure when running many tests
930+
// in parallel.
931+
writer.ChunkSize = 256_000
927932
_, copyErr := io.Copy(writer, content)
928933
// We have to make sure to call Close() here in order to tell it to finish
929934
// the upload operation.

0 commit comments

Comments
 (0)