File tree Expand file tree Collapse file tree
main/java/io/harness/events
test/java/io/harness/events Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Events module
2+
3+ This module provides a generic events management system.
4+
5+ Allows the definition of internal and external events interdependencies, as well as registration.
Original file line number Diff line number Diff line change @@ -104,8 +104,11 @@ public boolean eventAlreadyTriggered(E event) {
104104 try {
105105 mProcessQueue .execute (latch ::countDown );
106106 latch .await ();
107- } catch (RejectedExecutionException | InterruptedException e ) {
108- // If executor is shut down or interrupted, just check current state
107+ } catch (RejectedExecutionException e ) {
108+ // Executor is shut down
109+ } catch (InterruptedException e ) {
110+ // Restore interrupt status; check current state
111+ Thread .currentThread ().interrupt ();
109112 }
110113
111114 synchronized (mLock ) {
Original file line number Diff line number Diff line change @@ -222,9 +222,6 @@ public void orderTimedOutIsSuppressedWhenDishServedFires() throws InterruptedExc
222222 // ORDER_TIMED_OUT should be suppressed
223223 eventsManager .notifyInternalEvent (KitchenActivity .TIMEOUT_REACHED , null );
224224
225- // Give some time for potential (incorrect) processing
226- Thread .sleep (100 );
227-
228225 assertEquals (0 , timeoutCount .get ());
229226 assertFalse (eventsManager .eventAlreadyTriggered (CookingEvent .ORDER_TIMED_OUT ));
230227 }
You can’t perform that action at this time.
0 commit comments