Skip to content

Commit

Permalink
Check rules every 1/4 of a second in integration tests
Browse files Browse the repository at this point in the history
Test to ensure rule checking doesn't interfere with normal behavior
  • Loading branch information
capnspacehook committed Sep 22, 2023
1 parent 6e8615a commit 15b264d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions whalewall_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func startWhalewall(t *testing.T, is *is.I, tempDir string) func() {
func startBinary(t *testing.T, is *is.I, tempDir string) func() {
t.Helper()

wwCmd := exec.Command(*whalewallBinary, "-debug", "-d", tempDir)
wwCmd := exec.Command(*whalewallBinary, "-debug", "-d", tempDir, "-i=250ms")
wwCmd.Stdout = os.Stdout
wwCmd.Stderr = os.Stderr
err := wwCmd.Start()
Expand All @@ -229,7 +229,7 @@ func startBinary(t *testing.T, is *is.I, tempDir string) func() {
func startContainer(t *testing.T, is *is.I, tempDir string) func() {
t.Helper()

dockerCmd := exec.Command(
dockerCmd := exec.Command(

Check failure on line 232 in whalewall_test.go

View workflow job for this annotation

GitHub Actions / lint-go / Run golangci-lint

File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/capnspacehook/whalewall) (gci)
"docker",
"run",
"--cap-add=NET_ADMIN",
Expand All @@ -240,7 +240,8 @@ func startContainer(t *testing.T, is *is.I, tempDir string) func() {
*whalewallImage,
"-d=/data",
"-debug",
)
"-i=250ms",

Check failure on line 243 in whalewall_test.go

View workflow job for this annotation

GitHub Actions / lint-go / Run golangci-lint

File is not `gci`-ed with --skip-generated -s standard -s default -s prefix(github.com/capnspacehook/whalewall) (gci)
)
dockerCmd.Stdout = os.Stdout
dockerCmd.Stderr = os.Stderr
err := dockerCmd.Start()
Expand Down Expand Up @@ -270,7 +271,7 @@ func startFunc(t *testing.T, is *is.I, tempDir string) func() {
logger.Info("starting whalewall")
ctx, cancel := context.WithCancel(context.Background())
dbFile := filepath.Join(tempDir, "db.sqlite")
r, err := NewRuleManager(ctx, logger, dbFile, defaultTimeout, time.Minute)
r, err := NewRuleManager(ctx, logger, dbFile, defaultTimeout, 250*time.Millisecond)
is.NoErr(err)
err = r.Start(ctx)
is.NoErr(err)
Expand Down

0 comments on commit 15b264d

Please sign in to comment.