Commit 9a8ef47
committed
Fix random failing ServiceSupplierTestCase.testOptionalReferences #488
The ServiceSupplierTestCase.testOptionalReferences test case randomly
fails. The test aims to wait for services to be enabled or disabled, but
it only waits until a single value is changed although it asserts that
multiple values are changed afterwards. This is a race condition, as the
order in which the values are changed or in which the changes are
visible is non-deterministic, also due to missing memory barriers.
This change addresses this issue via two means:
1. it makes the fields of the asserted values volatile to ensure that
changed values eventually become visible to the UI thread
2. it waits for all values to be changed before asserting their values
to allow different orders of value changes1 parent 9bf98d6 commit 9a8ef47
File tree
1 file changed
+4
-4
lines changed- runtime/tests/org.eclipse.e4.core.tests/src/org/eclipse/e4/core/internal/tests/di/extensions
1 file changed
+4
-4
lines changedLines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
274 | | - | |
| 274 | + | |
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| |||
0 commit comments