-
Notifications
You must be signed in to change notification settings - Fork 294
Schedule workflow execution immediately #1544
Schedule workflow execution immediately #1544
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After fixing tests this LGTM.
last = time.Now() | ||
r = append(r, r1) | ||
} | ||
// we should have either 21 or 23 minus 0 missed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I see. I changed the comment through all tests to be more appropriate. Now for each of tests cases, window-width is 200ms, so for interval 10ms it is expected to get in a range 19 - 22 responses (or 15-18 for tests when there are some missed responses).
@jcooklin, could you run those tests on your system to confirm that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100 of 100 runs were successful!
@@ -50,26 +94,28 @@ func TestWindowedSchedule(t *testing.T) { | |||
time.Sleep(w.Interval * 2) | |||
} | |||
} | |||
// we should have either 16 or 17 minus 3 missed | |||
So(len(r), ShouldBeBetweenOrEqual, 15, 17) | |||
// we should have either 17 or 19 minus 4 missed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the test with 4 missed responses, the range has been changed to 15 -18.
Notice that for a test without missed responses, 19- 22 responses are expected to receive.
@@ -100,14 +147,23 @@ func TestWindowedSchedule(t *testing.T) { | |||
time.Sleep(w.Interval * 2) | |||
} | |||
} | |||
// we should have either 16 or 17 minus 3 missed | |||
So(len(r), ShouldBeBetweenOrEqual, 10, 12) | |||
// we should have either 12 or 14 results minus 4 missed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Should have between 12 and 14 results"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
windowed width has been changed to 200ms to be more corresponding to the other tests-cases.
- applicable for simple and windowed schedule, not applicable for cron shedule
b8b22d5
to
9677fd5
Compare
Related to #985
This PR is a part of the work being planned related to a single run task.
Before:
After:
Summary of changes:
task.Spin()
(see scheduler/task.go#255), so for the first run lastFireTime equals time.Time{}Testing done:
@intelsdi-x/snap-maintainers