Skip to content

Commit f62e3ef

Browse files
committed
concurrency in tests
1 parent bfc605a commit f62e3ef

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: scripts/test.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -245,14 +245,21 @@ func main() {
245245
wg.Wait()
246246
}
247247
if !*noBsbTest {
248+
var wg sync.WaitGroup
248249
buildTestDir := filepath.Join("jscomp", "build_tests")
249250
files, err := ioutil.ReadDir(buildTestDir)
250251
checkError(err)
251252

252253
for _, file := range files {
254+
file := file
255+
wg.Add(1)
253256
if file.IsDir() {
254-
bsbInDir(buildTestDir, file.Name())
257+
go func(){
258+
defer wg.Done()
259+
bsbInDir(buildTestDir, file.Name())
260+
}()
255261
}
256262
}
263+
wg.Wait()
257264
}
258265
}

0 commit comments

Comments
 (0)