Commit 00ffe2b
committed
Handle negative delay times
Prior to this commit, `JavaFxScheduler` asserted that delay time values
must non-negative and less than `Integer.MAX_VALUE` for compatibility
with the JavaFX timer. This resulted in the possibility of false negative
test failures for `JavaFxSchedulerTest#testPeriodicScheduling`, because
when the system is under load (e.g. when CPUs are maxed out), negative
delay time values get passed to `#schedule`. These negative values are
perfectly valid, indicating no delay (and are documented as such--see
`Worker#schedule` Javadoc).
This commit removes the assertion of non-negative values, and instead
simply adapts any negative value to zero, which keeps the JavaFX timing
infrastructure happy. It also removes the upper boundary of
`Integer.MAX_VALUE` for delay times, as it does not appear that JavaFX
actually imposes any such limitation.
JavaFxSchedulerTest#testInvalidDelayValues has been removed entirely, as
there is essentially no such thing as an "invalid delay value" at this
point.
All remaining tests now typically succeed save for very infrequent
failures of `JavaFxSchedulerTest#testNestedActions`. The reason for these
non-deterministic failures is as yet unknown, but because they appear to
be unrelated to the changes addressed in this commit, no attempt is made
here to diagnose and fix them.
Note that this branch includes @Lestard's pull request #4, which will
indeed be necessary to fix "display not found" errors under Travis CI's
headless environment. i.e. if that commit isn't included, this changes
in this commit won't have a chance of succeeding.1 parent ad77fcb commit 00ffe2b
File tree
2 files changed
+3
-27
lines changed- src
- main/java/rx/schedulers
- test/java/rx/schedulers
2 files changed
+3
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 49 | | |
54 | 50 | | |
55 | 51 | | |
| |||
71 | 67 | | |
72 | 68 | | |
73 | 69 | | |
74 | | - | |
75 | | - | |
76 | 70 | | |
77 | 71 | | |
| 72 | + | |
78 | 73 | | |
79 | 74 | | |
80 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | 76 | | |
96 | 77 | | |
97 | 78 | | |
| |||
0 commit comments