mirror of https://github.com/databricks/cli.git
test in parallel with waitgroup
This commit is contained in:
parent
d7f31f9eae
commit
fc3ae6371e
|
@ -10,6 +10,7 @@ import (
|
||||||
"path"
|
"path"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
"sync"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/databricks/cli/libs/filer"
|
"github.com/databricks/cli/libs/filer"
|
||||||
|
@ -364,9 +365,17 @@ func TestFilerReadDir(t *testing.T) {
|
||||||
func TestAccFilerWorkspaceNotebook(t *testing.T) {
|
func TestAccFilerWorkspaceNotebook(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
wg := sync.WaitGroup{}
|
||||||
|
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
|
wg.Add(1)
|
||||||
|
go func() {
|
||||||
testAccFilerWorkspacenotebook(t)
|
testAccFilerWorkspacenotebook(t)
|
||||||
|
wg.Done()
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
func testAccFilerWorkspacenotebook(t *testing.T) {
|
func testAccFilerWorkspacenotebook(t *testing.T) {
|
||||||
|
@ -668,9 +677,17 @@ func testAccFilerWorkspaceFilesExtensionsDelete(t *testing.T) {
|
||||||
func TestAccFilerWorkspaceFilesExtensionsDelete(t *testing.T) {
|
func TestAccFilerWorkspaceFilesExtensionsDelete(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
wg := sync.WaitGroup{}
|
||||||
|
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
|
wg.Add(1)
|
||||||
|
go func() {
|
||||||
testAccFilerWorkspaceFilesExtensionsDelete(t)
|
testAccFilerWorkspaceFilesExtensionsDelete(t)
|
||||||
|
wg.Done()
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFilerWorkspaceFilesExtensionsStat(t *testing.T) {
|
func TestFilerWorkspaceFilesExtensionsStat(t *testing.T) {
|
||||||
|
@ -793,9 +810,17 @@ func testAccWorkspaceFilesExtensionsNotebooksAreNotDeletedAsFiles(t *testing.T)
|
||||||
func TestAccWorkspaceFilesExtensionsNotebooksAreNotDeletedAsFiles(t *testing.T) {
|
func TestAccWorkspaceFilesExtensionsNotebooksAreNotDeletedAsFiles(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
|
wg := sync.WaitGroup{}
|
||||||
|
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
|
wg.Add(1)
|
||||||
|
go func() {
|
||||||
testAccWorkspaceFilesExtensionsNotebooksAreNotDeletedAsFiles(t)
|
testAccWorkspaceFilesExtensionsNotebooksAreNotDeletedAsFiles(t)
|
||||||
|
wg.Done()
|
||||||
|
}()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wg.Wait()
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestWorkspaceFilesExtensions_ExportFormatIsPreserved(t *testing.T) {
|
func TestWorkspaceFilesExtensions_ExportFormatIsPreserved(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue