File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -1063,6 +1063,7 @@ func TestCacheLaggingWatcher(t *testing.T) {
10631063 wantExactEventCount int
10641064 wantAtMaxEventCount int
10651065 wantClosed bool
1066+ postGenerateDelay time.Duration
10661067 }{
10671068 {
10681069 name : "all event fit" ,
@@ -1091,6 +1092,7 @@ func TestCacheLaggingWatcher(t *testing.T) {
10911092 eventCount : 12 ,
10921093 wantAtMaxEventCount : 1 , // Either 0 or 1.
10931094 wantClosed : true ,
1095+ postGenerateDelay : 100 * time .Millisecond ,
10941096 },
10951097 }
10961098
@@ -1113,6 +1115,11 @@ func TestCacheLaggingWatcher(t *testing.T) {
11131115 ch := c .Watch (t .Context (), prefix , clientv3 .WithPrefix ())
11141116
11151117 generateEvents (t , client , prefix , tt .eventCount )
1118+
1119+ if tt .postGenerateDelay > 0 {
1120+ time .Sleep (tt .postGenerateDelay )
1121+ }
1122+
11161123 gotEvents , ok := collectAndAssertAtomicEvents (t , ch )
11171124 closed := ! ok
11181125
You can’t perform that action at this time.
0 commit comments