Skip to content

Commit 13dd322

Browse files
authored
Small fix in jvmStats test (opensearch-project#14075)
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>
1 parent 44a8c4a commit 13dd322

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

server/src/test/java/org/opensearch/action/admin/cluster/node/stats/NodeStatsTests.java

+14-16
Original file line numberDiff line numberDiff line change
@@ -682,24 +682,22 @@ public static NodeStats createNodeStats(boolean remoteStoreStats) throws IOExcep
682682
);
683683
}
684684
JvmStats.Classes classes = new JvmStats.Classes(randomNonNegativeLong(), randomNonNegativeLong(), randomNonNegativeLong());
685-
jvmStats = frequently()
686-
? new JvmStats(
685+
jvmStats = new JvmStats(
686+
randomNonNegativeLong(),
687+
randomNonNegativeLong(),
688+
new JvmStats.Mem(
687689
randomNonNegativeLong(),
688690
randomNonNegativeLong(),
689-
new JvmStats.Mem(
690-
randomNonNegativeLong(),
691-
randomNonNegativeLong(),
692-
randomNonNegativeLong(),
693-
randomNonNegativeLong(),
694-
randomNonNegativeLong(),
695-
memoryPools
696-
),
697-
threads,
698-
garbageCollectors,
699-
randomBoolean() ? Collections.emptyList() : bufferPoolList,
700-
classes
701-
)
702-
: null;
691+
randomNonNegativeLong(),
692+
randomNonNegativeLong(),
693+
randomNonNegativeLong(),
694+
memoryPools
695+
),
696+
threads,
697+
garbageCollectors,
698+
randomBoolean() ? Collections.emptyList() : bufferPoolList,
699+
classes
700+
);
703701
}
704702
ThreadPoolStats threadPoolStats = null;
705703
if (frequently()) {

0 commit comments

Comments
 (0)