Skip to content

Commit c4578a3

Browse files
committed
Make test run for multi node env
Signed-off-by: Owais <[email protected]>
1 parent 8c40f86 commit c4578a3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/test_security.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,4 +87,4 @@ jobs:
8787
# switching the user, as OpenSearch cluster can only be started as root/Administrator on linux-deb/linux-rpm/windows-zip.
8888
run: |
8989
chown -R 1000:1000 `pwd`
90-
su `id -un 1000` -c "whoami && java -version && ./gradlew integTest -PnumNodes=3 -Dsecurity.enabled=true"
90+
su `id -un 1000` -c "whoami && java -version && ./gradlew integTest -PnumNodes=2 -Dsecurity.enabled=true"

src/test/java/org/opensearch/neuralsearch/rest/RestNeuralStatsActionIT.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,12 @@ public void test_textEmbedding() throws Exception {
9191
stats = parseInfoStatsResponse(responseBody);
9292
nodesStats = parseNodeStatsResponse(responseBody);
9393

94+
int totalExecutions = nodesStats.stream()
95+
.mapToInt(nodeStats -> (int) getNestedValue(nodeStats, EventStatName.TEXT_EMBEDDING_PROCESSOR_EXECUTIONS))
96+
.sum();
97+
9498
// Parse json to get stats
95-
assertEquals(3, getNestedValue(nodesStats.getFirst(), EventStatName.TEXT_EMBEDDING_PROCESSOR_EXECUTIONS));
99+
assertEquals(3, totalExecutions);
96100
assertEquals(1, getNestedValue(stats, InfoStatName.TEXT_EMBEDDING_PROCESSORS));
97101

98102
// Reset stats

0 commit comments

Comments
 (0)