Skip to content

Commit

Permalink
test: fix random failure in rule state test
Browse files Browse the repository at this point in the history
Signed-off-by: Jiyong Huang <[email protected]>
  • Loading branch information
ngjaying committed Nov 16, 2023
1 parent 9f7174a commit bf80b59
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions internal/topo/rule/ruleState_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"time"

"github.com/benbjohnson/clock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/lf-edge/ekuiper/internal/conf"
Expand Down Expand Up @@ -301,10 +302,12 @@ func TestMultipleAccess(t *testing.T) {
}
}
wg.Wait()
rs.Start()
fmt.Printf("before %d:%d\n", 10, rs.triggered)
err = rs.Stop()
assert.NoError(t, err)
fmt.Printf("%d:%d\n", 10, rs.triggered)
if rs.triggered != 1 {
t.Errorf("triggered mismatch:\n\nexp=%#v\n\ngot=%#v\n\n", 1, rs.triggered)
if rs.triggered != 0 {
t.Errorf("triggered mismatch:\n\nexp=%#v\n\ngot=%#v\n\n", 0, rs.triggered)
}
}

Expand Down

0 comments on commit bf80b59

Please sign in to comment.