From 2b8429eff752dcf812a8716b878654ccb0808757 Mon Sep 17 00:00:00 2001 From: Roger Abelenda Date: Wed, 13 Mar 2024 15:48:50 -0300 Subject: [PATCH] In some corner cases we have seen TestRunStatistics from AzureEngine to be null, this fix waits a little longer in such scenarios to avoid NPE --- .../java/us/abstracta/jmeter/javadsl/azure/AzureEngine.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jmeter-java-dsl-azure/src/main/java/us/abstracta/jmeter/javadsl/azure/AzureEngine.java b/jmeter-java-dsl-azure/src/main/java/us/abstracta/jmeter/javadsl/azure/AzureEngine.java index e384c770..ef5323ce 100644 --- a/jmeter-java-dsl-azure/src/main/java/us/abstracta/jmeter/javadsl/azure/AzureEngine.java +++ b/jmeter-java-dsl-azure/src/main/java/us/abstracta/jmeter/javadsl/azure/AzureEngine.java @@ -532,7 +532,8 @@ private TestRun awaitTestEnd(TestRun testRun) private TestRun awaitVirtualUsers(TestRun testRun) throws InterruptedException, IOException { Instant start = Instant.now(); - while (testRun.getVirtualUsers() == null && !hasTimedOut(TEST_END_TIMEOUT, start)) { + while ((testRun.getVirtualUsers() == null || testRun.getTestRunStatistics() == null) + && !hasTimedOut(TEST_END_TIMEOUT, start)) { Thread.sleep(STATUS_POLL_PERIOD.toMillis()); testRun = apiClient.findTestRunById(testRun.getId()); }