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 <lukas.vlcek@aiven.io>
  • Loading branch information
lukas-vlcek authored and wangdongyu.danny committed Aug 22, 2024
1 parent d98ec7a commit 6170565
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 6170565

Please sign in to comment.