@@ -267,14 +267,65 @@ void filterAddEventBeforeUpdate() {
267267 assertNoEventProduced ();
268268 }
269269
270+ @ Test
271+ void multipleCachingFilteringUpdates () {
272+ withRealTemporaryResourceCache ();
273+ CountDownLatch latch = sendForEventFilteringUpdate (2 );
274+ CountDownLatch latch2 =
275+ sendForEventFilteringUpdate (withResourceVersion (testDeployment (), 2 ), 3 );
276+
277+ informerEventSource .onUpdate (
278+ deploymentWithResourceVersion (1 ), deploymentWithResourceVersion (2 ));
279+ latch .countDown ();
280+ latch2 .countDown ();
281+ informerEventSource .onUpdate (
282+ deploymentWithResourceVersion (2 ), deploymentWithResourceVersion (3 ));
283+
284+ assertNoEventProduced ();
285+ }
286+
287+ @ Test
288+ void multipleCachingFilteringUpdates_variation2 () {
289+ withRealTemporaryResourceCache ();
290+
291+ CountDownLatch latch = sendForEventFilteringUpdate (2 );
292+ CountDownLatch latch2 =
293+ sendForEventFilteringUpdate (withResourceVersion (testDeployment (), 2 ), 3 );
294+
295+ informerEventSource .onUpdate (
296+ deploymentWithResourceVersion (1 ), deploymentWithResourceVersion (2 ));
297+ latch .countDown ();
298+ informerEventSource .onUpdate (
299+ deploymentWithResourceVersion (2 ), deploymentWithResourceVersion (3 ));
300+ latch2 .countDown ();
301+
302+ assertNoEventProduced ();
303+ }
304+
305+ @ Test
306+ void multipleCachingFilteringUpdates_variation3 () {
307+ withRealTemporaryResourceCache ();
308+
309+ CountDownLatch latch = sendForEventFilteringUpdate (2 );
310+ CountDownLatch latch2 =
311+ sendForEventFilteringUpdate (withResourceVersion (testDeployment (), 2 ), 3 );
312+
313+ latch .countDown ();
314+ informerEventSource .onUpdate (
315+ deploymentWithResourceVersion (1 ), deploymentWithResourceVersion (2 ));
316+ informerEventSource .onUpdate (
317+ deploymentWithResourceVersion (2 ), deploymentWithResourceVersion (3 ));
318+ latch2 .countDown ();
319+
320+ assertNoEventProduced ();
321+ }
322+
270323 private void assertNoEventProduced () {
271324 await ()
272325 .pollDelay (Duration .ofMillis (50 ))
273326 .timeout (Duration .ofMillis (51 ))
274327 .untilAsserted (
275- () -> {
276- verify (informerEventSource , never ()).handleEvent (any (), any (), any (), any ());
277- });
328+ () -> verify (informerEventSource , never ()).handleEvent (any (), any (), any (), any ()));
278329 }
279330
280331 private void expectHandleEvent (int newResourceVersion , int oldResourceVersion ) {
0 commit comments