File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -885,11 +885,7 @@ func TestPullWithParallelism(t *testing.T) {
885885 },
886886 {
887887 name : "set chunk size" ,
888- opts : []snapshotterConfigOpt {
889- func (cfg * config.Config ) {
890- cfg .PullModes .Parallel .ConcurrentDownloadChunkSize = 1_000_000
891- },
892- },
888+ opts : []snapshotterConfigOpt {withConcurrentDownloadChunkSize (1_000_000 )},
893889 },
894890 }
895891
@@ -902,11 +898,7 @@ func TestPullWithParallelism(t *testing.T) {
902898 },
903899 {
904900 name : "parallel unpacking" ,
905- opts : []snapshotterConfigOpt {
906- func (cfg * config.Config ) {
907- cfg .PullModes .Parallel .MaxConcurrentUnpacks = 3
908- },
909- },
901+ opts : []snapshotterConfigOpt {withConcurrentUnpacks (3 )},
910902 },
911903 }
912904
Original file line number Diff line number Diff line change @@ -377,6 +377,18 @@ func withUnboundedPullUnpack() snapshotterConfigOpt {
377377 }
378378}
379379
380+ func withConcurrentDownloadChunkSize (chunkSize int64 ) snapshotterConfigOpt {
381+ return func (c * config.Config ) {
382+ c .PullModes .Parallel .ConcurrentDownloadChunkSize = chunkSize
383+ }
384+ }
385+
386+ func withConcurrentUnpacks (n int64 ) snapshotterConfigOpt {
387+ return func (c * config.Config ) {
388+ c .PullModes .Parallel .MaxConcurrentUnpacks = n
389+ }
390+ }
391+
380392func withDiscardUnpackedLayers () snapshotterConfigOpt {
381393 return func (c * config.Config ) {
382394 c .PullModes .Parallel .DiscardUnpackedLayers = true
You can’t perform that action at this time.
0 commit comments