Make MetricsITBase tests serial instead of parallelizable (CASSJAVA-19) #2048
+0
−9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change fixes random failures by removing
MicrometerMetricsIT
,MicroProfileMetricsIT
andDropwizardMetricsIT
from theParallelizableTests
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 manipulatesAbstractMetricUpdater.MIN_EXPIRE_AFTER
in order to setDefaultDriverOption.METRICS_NODE_EXPIRE_AFTER
to 1 second during session initialization. OtherwiseMIN_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:
cassandra-java-driver/integration-tests/src/test/java/com/datastax/oss/driver/core/metrics/MetricsITBase.java
Line 157 in 17ebe60
cassandra-java-driver/integration-tests/src/test/java/com/datastax/oss/driver/core/metrics/MetricsITBase.java
Line 186 in 17ebe60
The test waits around 10 seconds for the change to happen, but in such case it would need to wait for 5 minutes.
Warnings with this pattern should be visible when the test fails on the CI:
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.