Skip to content

Commit

Permalink
Log task start time to verify delays and modify the loop to skip inte…
Browse files Browse the repository at this point in the history
…rmediate state
  • Loading branch information
bhavanisn committed Oct 30, 2023
1 parent 66e3fd1 commit e702054
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@ protected void tearDown() throws Exception {
}

private char bar() {
System.out.println("TASK A loaded at:"+java.lang.System.currentTimeMillis());
char state = 'A';
while (keepOnGoing) {
int count = 0;
while (keepOnGoing ||
(state == '?' && count <= 1)) {
int result = goo();
switch (result) {
case 4*'A':
Expand All @@ -83,6 +86,7 @@ private char bar() {
default:
AssertJUnit.assertTrue("switching to ?", state == 'A' && result > 4*'A' && result < 4*'B');
state = '?';
++count;
break;
}
}
Expand Down Expand Up @@ -114,9 +118,13 @@ public void testNOPing(){
public void wakeUp(int event) {
switch (event) {
case TASK_LOAD_B:
f = new B(); break;
f = new B();
System.out.println("TASK B loaded at:"+java.lang.System.currentTimeMillis());
break;
case TASK_FIN:
keepOnGoing = false; break;
keepOnGoing = false;
System.out.println("TASK FIN loaded at:"+java.lang.System.currentTimeMillis());
break;
}

}
Expand Down

0 comments on commit e702054

Please sign in to comment.