Skip to content

Commit 71c6977

Browse files
refactor(e2e): Add additional check to a flakey test
This test fails a later assertion that the device's reported property is the expected value, but this may be because the twin had more than one reported property. This check allows us to debug if the test is failing because of that reason
1 parent dfdf86c commit 71c6977

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

iot-e2e-tests/common/src/test/java/tests/integration/com/microsoft/azure/sdk/iot/iothub/MultiplexingClientTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,8 @@ private static void testReportedPropertiesFlow(DeviceClient deviceClient, TwinCl
911911
Twin serviceClientTwin = twinClientServiceClient.get(deviceClient.getConfig().getDeviceId());
912912

913913
com.microsoft.azure.sdk.iot.service.twin.TwinCollection retrievedReportedProperties = serviceClientTwin.getReportedProperties();
914-
assertTrue(retrievedReportedProperties.size() > 0);
914+
assertTrue("Twin had no reported properties", retrievedReportedProperties.size() > 0);
915+
assertEquals("Twin had more reported properties than expected", 1, retrievedReportedProperties.size());
915916
String retrievedReportedPropertyKey = retrievedReportedProperties.keySet().iterator().next();
916917
assertEquals(expectedPropertyKey, retrievedReportedPropertyKey);
917918
String actualReportedPropertyValue = (String) retrievedReportedProperties.get(retrievedReportedPropertyKey);

0 commit comments

Comments
 (0)