Skip to content

Commit

Permalink
Small fix in jvmStats test (opensearch-project#14075)
Browse files Browse the repository at this point in the history
Removing second use of the `frequentyl()` function. This function is alraedy used in the
beginning of the testing block immediately after the declaration of `jvmStats` variable.
The second use of the `frequently()` could cause all the other variables that were carefully
prepared for the constructor to not be used at all.

Signed-off-by: Lukáš Vlček <[email protected]>
  • Loading branch information
lukas-vlcek authored Jun 10, 2024
1 parent 44a8c4a commit 13dd322
Showing 1 changed file with 14 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -682,24 +682,22 @@ public static NodeStats createNodeStats(boolean remoteStoreStats) throws IOExcep
);
}
JvmStats.Classes classes = new JvmStats.Classes(randomNonNegativeLong(), randomNonNegativeLong(), randomNonNegativeLong());
jvmStats = frequently()
? new JvmStats(
jvmStats = new JvmStats(
randomNonNegativeLong(),
randomNonNegativeLong(),
new JvmStats.Mem(
randomNonNegativeLong(),
randomNonNegativeLong(),
new JvmStats.Mem(
randomNonNegativeLong(),
randomNonNegativeLong(),
randomNonNegativeLong(),
randomNonNegativeLong(),
randomNonNegativeLong(),
memoryPools
),
threads,
garbageCollectors,
randomBoolean() ? Collections.emptyList() : bufferPoolList,
classes
)
: null;
randomNonNegativeLong(),
randomNonNegativeLong(),
randomNonNegativeLong(),
memoryPools
),
threads,
garbageCollectors,
randomBoolean() ? Collections.emptyList() : bufferPoolList,
classes
);
}
ThreadPoolStats threadPoolStats = null;
if (frequently()) {
Expand Down

0 comments on commit 13dd322

Please sign in to comment.