Skip to content

Commit 8dd861c

Browse files
authored
Small file sizes were not calculated correctly, fixed now (#4816)
1 parent e48e3a7 commit 8dd861c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/cloud_controller/benchmark/blobstore.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Blobstore
1818
'10MB' => 10 * 1024 * 1024,
1919
'50MB' => 50 * 1024 * 1024,
2020
'100MB' => 100 * 1024 * 1024,
21-
'500MB' => 400 * 1024 * 1024,
21+
'500MB' => 500 * 1024 * 1024,
2222
'1000MB' => 1000 * 1024 * 1024
2323
}.freeze
2424

@@ -138,7 +138,7 @@ def write_file_of_size(path, bytes)
138138
remaining = bytes
139139
while remaining > 0
140140
to_write = [CHUNK_1MB.bytesize, remaining].min
141-
f.write(CHUNK_1MB, to_write)
141+
f.write(CHUNK_1MB.byteslice(0, to_write))
142142
remaining -= to_write
143143
end
144144
end

0 commit comments

Comments
 (0)