@@ -12,10 +12,6 @@ import (
12
12
"github.com/stretchr/testify/require"
13
13
)
14
14
15
- const (
16
- pollWaitSecs = 15.0
17
- )
18
-
19
15
// TestAutoCommit tests/demonstrates the behavior of disabling the auto-commit functionality.
20
16
// The autocommiter sends the offsets of the marked messages to the broker regularily. If the processor shuts down
21
17
// (or the group rebalances), the offsets are sent one last time, so just turning it of is not enough.
@@ -78,7 +74,7 @@ func TestAutoCommit(t *testing.T) {
78
74
79
75
// run the first processor
80
76
_ , cancel , done := runProc (createProc ())
81
- pollTimed (t , "all-received1" , pollWaitSecs , func () bool {
77
+ pollTimed (t , "all-received1" , func () bool {
82
78
return len (offsets ) == 10 && offsets [0 ] == 0
83
79
})
84
80
@@ -96,7 +92,7 @@ func TestAutoCommit(t *testing.T) {
96
92
97
93
// --> we'll receive all messages again
98
94
// --> i.e., no offsets were committed
99
- pollTimed (t , "all-received2" , pollWaitSecs , func () bool {
95
+ pollTimed (t , "all-received2" , func () bool {
100
96
return len (offsets ) == 10 && offsets [0 ] == 0
101
97
})
102
98
@@ -153,7 +149,7 @@ func TestUnmarkedMessages(t *testing.T) {
153
149
154
150
// run the first processor
155
151
runProc (createProc ())
156
- pollTimed (t , "all-received1" , pollWaitSecs , func () bool {
152
+ pollTimed (t , "all-received1" , func () bool {
157
153
return len (values ) == 2 && values [0 ] == 1
158
154
})
159
155
@@ -162,7 +158,7 @@ func TestUnmarkedMessages(t *testing.T) {
162
158
163
159
// restart -> we'll only receive the second message
164
160
runProc (createProc ())
165
- pollTimed (t , "all-received2" , pollWaitSecs , func () bool {
161
+ pollTimed (t , "all-received2" , func () bool {
166
162
return len (values ) == 1 && values [0 ] == 2
167
163
})
168
164
}
0 commit comments