lighten up on concurrency test, add both archive file, and archive
This commit is contained in:
parent
e3d512edcc
commit
939d31dc37
1 changed files with 20 additions and 1 deletions
|
@ -31,8 +31,10 @@ func TestArchiveConcurrency(t *testing.T) {
|
|||
|
||||
var wg sync.WaitGroup
|
||||
|
||||
t.Log("== ExtractArchiveFile ==")
|
||||
|
||||
// Slam it, see if it breaks.
|
||||
for _ = range 100_000 {
|
||||
for _ = range 10_000 {
|
||||
go func() {
|
||||
wg.Add(1)
|
||||
defer wg.Done()
|
||||
|
@ -50,6 +52,23 @@ func TestArchiveConcurrency(t *testing.T) {
|
|||
|
||||
wg.Wait()
|
||||
|
||||
t.Log("== ExtractArchive ==")
|
||||
// Slam it, see if it breaks.
|
||||
for _ = range 10_000 {
|
||||
go func() {
|
||||
wg.Add(1)
|
||||
defer wg.Done()
|
||||
|
||||
err = archive.Extract(ExtractOptions{
|
||||
Overwrite: true,
|
||||
Folder: testArchiveBaseDir + "/extracted/zip",
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
}()
|
||||
}
|
||||
|
||||
wg.Wait()
|
||||
|
||||
err = os.RemoveAll(testArchiveBaseDir + "/extracted")
|
||||
assert.NoError(t, err)
|
||||
|
||||
|
|
Loading…
Reference in a new issue