Description
JvmThreadsMetricsTest.testInvalidThreadIds is flaky — it counts threads
by state between two scrapes, but background threads (GC, JIT, etc.) can
start between the snapshots, causing a mismatch.
Seen on Java 17 CI:
expected: 6.0
but was: 7.0
at line 139.
Suggested fix
Instead of comparing exact counts, compare the delta (or use
isGreaterThanOrEqualTo for states that can only grow).