lighten up on concurrency test, add both archive file, and archive

This commit is contained in:
Shane C. 2024-12-03 11:39:22 -05:00
parent e3d512edcc
commit 939d31dc37
Signed by: Shane C.
GPG key ID: E46B5FEA35B22FF9

View file

@ -31,8 +31,10 @@ func TestArchiveConcurrency(t *testing.T) {
var wg sync.WaitGroup var wg sync.WaitGroup
t.Log("== ExtractArchiveFile ==")
// Slam it, see if it breaks. // Slam it, see if it breaks.
for _ = range 100_000 { for _ = range 10_000 {
go func() { go func() {
wg.Add(1) wg.Add(1)
defer wg.Done() defer wg.Done()
@ -50,6 +52,23 @@ func TestArchiveConcurrency(t *testing.T) {
wg.Wait() 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") err = os.RemoveAll(testArchiveBaseDir + "/extracted")
assert.NoError(t, err) assert.NoError(t, err)