Commit 771cc50
committed
Make MetricsITBase tests serial instead of parallelizable (CASSJAVA-19)
This change fixes random failures by removing `MicrometerMetricsIT`,
`MicroProfileMetricsIT` and `DropwizardMetricsIT` from the
`ParallelizableTests` category.
It is not the only solution but seems to be the simplest workaround.
The reasoning is as follows:
`should_evict_down_node_metrics_when_timeout_fires()` has two places where it
manipulates `AbstractMetricUpdater.MIN_EXPIRE_AFTER` in order to set
`DefaultDriverOption.METRICS_NODE_EXPIRE_AFTER` to 1 second during session
initialization. Otherwise `MIN_EXPIRE_AFTER` would not allow for that and
warning log would be printed about using higher value than what user wanted to
set.
It lowers it before session initialization:
https://github.com/apache/cassandra-java-driver/blob/17ebe6092e2877d8c524e07489c4c3d005cfeea5/integration-tests/src/test/java/com/datastax/oss/driver/core/metrics/MetricsITBase.java#L157
And sets it back to 5 mintues at the end of the test:
https://github.com/apache/cassandra-java-driver/blob/17ebe6092e2877d8c524e07489c4c3d005cfeea5/integration-tests/src/test/java/com/datastax/oss/driver/core/metrics/MetricsITBase.java#L186
The code comment in AbstractMetricUpdater also mentions that this variable is
intentionally not made final for testing purposes.
I believe this is what causes the intermittent failures. When those three tests
that extend this class run in parallel it is possible that test B sets the
minimum back to 5 minutes after the test A lowers it to 1 second but before
test A initializes its session.
Warnings with this pattern should be visible when the test fails on the CI:
```
c.d.o.d.i.c.m.AbstractMetricUpdater - [s6] Value too low for advanced.metrics.node.expire-after: PT1S. Forcing to PT5M instead.
```
I can confirm that this is what was happening when I was testing this locally,
but I did not try to search for the logs on cassandra-java-driver's CI.1 parent 17ebe60 commit 771cc50
File tree
3 files changed
+0
-9
lines changed- integration-tests/src/test/java/com/datastax/oss/driver
- core/metrics
- metrics
- micrometer
- microprofile
3 files changed
+0
-9
lines changedLines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
44 | 42 | | |
45 | | - | |
46 | 43 | | |
47 | 44 | | |
48 | 45 | | |
| |||
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
40 | 39 | | |
41 | 40 | | |
42 | 41 | | |
43 | | - | |
44 | 42 | | |
45 | | - | |
46 | 43 | | |
47 | 44 | | |
48 | 45 | | |
| |||
Lines changed: 0 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
47 | | - | |
48 | 46 | | |
49 | | - | |
50 | 47 | | |
51 | 48 | | |
52 | 49 | | |
| |||
0 commit comments