Handle SimulateScenario requests (#330)

* Handle SimulateScenario requests

* actually use sendLeave

* fix local test failures due to filehandle limit
This commit is contained in:
David Zhao
2022-01-11 00:37:24 -08:00
committed by GitHub
parent e82b8ea0a0
commit c2ba26eee6
10 changed files with 157 additions and 24 deletions
+13 -2
View File
@@ -13,6 +13,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"sort"
"strings"
@@ -116,7 +117,7 @@ func PublishDocker() error {
// run unit tests, skipping integration
func Test() error {
mg.Deps(generateWire)
mg.Deps(generateWire, macULimit)
cmd := exec.Command("go", "test", "-short", "./...")
connectStd(cmd)
return cmd.Run()
@@ -124,7 +125,7 @@ func Test() error {
// run all tests including integration
func TestAll() error {
mg.Deps(generateWire)
mg.Deps(generateWire, macULimit)
// "-v", "-race",
cmd := exec.Command("go", "test", "./...", "-count=1", "-timeout=4m")
connectStd(cmd)
@@ -235,6 +236,16 @@ func connectStd(cmd *exec.Cmd) {
cmd.Stderr = os.Stderr
}
func macULimit() {
// raise ulimit if on mac
if runtime.GOOS != "darwin" {
return
}
cmd := exec.Command("ulimit", "-n", "10000")
connectStd(cmd)
cmd.Run()
}
// A helper checksum library that generates a fast, non-portable checksum over a directory of files
// it's designed as a quick way to bypass
type Checksummer struct {