github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/ais/test/randreader_test.go (about) 1 // Package integration_test. 2 /* 3 * Copyright (c) 2018-2024, NVIDIA CORPORATION. All rights reserved. 4 */ 5 package integration_test 6 7 import ( 8 "sync" 9 "testing" 10 11 "github.com/NVIDIA/aistore/api/apc" 12 "github.com/NVIDIA/aistore/cmn" 13 "github.com/NVIDIA/aistore/tools" 14 ) 15 16 func TestRandomReaderPutStress(t *testing.T) { 17 var ( 18 numworkers = 1000 19 numobjects = 10 // NOTE: increase this number if need be ... 20 bck = cmn.Bck{ 21 Name: "RRTestBucket", 22 Provider: apc.AIS, 23 } 24 proxyURL = tools.GetPrimaryURL() 25 baseParams = tools.BaseAPIParams(proxyURL) 26 wg = &sync.WaitGroup{} 27 dir = t.Name() 28 cksumType = bck.DefaultProps(initialClusterConfig).Cksum.Type 29 ) 30 31 tools.CreateBucket(t, proxyURL, bck, nil, true /*cleanup*/) 32 33 for range numworkers { 34 wg.Add(1) 35 go func() { 36 defer wg.Done() 37 tools.PutRR(t, baseParams, fileSize, cksumType, bck, dir, numobjects) 38 }() 39 } 40 wg.Wait() 41 }