[MAGNOLIA-2311] DelayedExecutorTest doesn't call executor.trigger() and so can never pass Created: 11/Aug/08  Updated: 09/Sep/08  Resolved: 09/Sep/08

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 3.6.1
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Julian Frank Assignee: Magnolia International
Resolution: Not an issue Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File DelayedExecutorTest.diff    
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

AFAIK and I could be wrong, the runnable.executed will never be true unless executor.trigger is at least called once after sleeping for 100 ms.

Index: DelayedExecutorTest.java
===================================================================
— DelayedExecutorTest.java (revision 17249)
+++ DelayedExecutorTest.java (working copy)
@@ -69,6 +69,7 @@
}
assertEquals(false, runnable.executed);
Thread.sleep(100);
+ executor.trigger();
assertEquals(true, runnable.executed);
}



 Comments   
Comment by Magnolia International [ 09/Sep/08 ]

the trigger() method is called (5 times) in the for loop just above; the execution will start after ~50ms, so the first assertion on runnable.executed is false. We then sleep ~100ms, and runnable.executed is then true.

Generated at Mon Feb 12 03:35:29 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.