Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2nd attempt to fix random EEM and EPM CI failures #34476

Merged
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ void FakeReadings::StartFakeReadings(EndpointId aEndpointId, int64_t aPower_mW,

if (bReset)
{
// Use a fixed random seed to try to avoid random CI test failures
// which are caused when the test is checking for 2 different numbers.
// This is statistically more likely when the test runs for a long time
// or if the seed is not set
srand(1);

mTotalEnergyImported = 0;
mTotalEnergyExported = 0;
}
Expand Down
4 changes: 2 additions & 2 deletions src/python_testing/TC_EEM_2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def steps_TC_EEM_2_2(self) -> list[TestStep]:
TestStep("4", "Wait 3 seconds"),
TestStep("4a", "TH reads from the DUT the CumulativeEnergyImported attribute",
"Verify the read is successful and note the value read."),
TestStep("5", "Wait 5 seconds"),
TestStep("5", "Wait 3 seconds"),
TestStep("5a", "TH reads from the DUT the CumulativeEnergyImported attribute",
"Verify the read is successful and that the value is greater than the value measured in step 4a."),
TestStep("6", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEM.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEM.TEST_EVENT_TRIGGER for Stop Fake Readings Test Event."),
Expand All @@ -80,7 +80,7 @@ async def test_TC_EEM_2_2(self):
cumulative_energy_imported = await self.read_eem_attribute_expect_success("CumulativeEnergyImported")

self.step("5")
time.sleep(5)
time.sleep(3)

self.step("5a")
cumulative_energy_imported_2 = await self.read_eem_attribute_expect_success("CumulativeEnergyImported")
Expand Down
4 changes: 2 additions & 2 deletions src/python_testing/TC_EEM_2_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def steps_TC_EEM_2_3(self) -> list[TestStep]:
TestStep("4", "Wait 6 seconds"),
TestStep("4a", "TH reads from the DUT the CumulativeEnergyExported attribute",
"Verify the read is successful and note the value read."),
TestStep("5", "Wait 11 seconds"),
TestStep("5", "Wait 6 seconds"),
TestStep("5a", "TH reads from the DUT the CumulativeEnergyExported attribute",
"Verify the read is successful and that the value is greater than the value measured in step 4a."),
TestStep("6", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEM.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEM.TEST_EVENT_TRIGGER for Stop Fake Readings Test Event."),
Expand All @@ -80,7 +80,7 @@ async def test_TC_EEM_2_3(self):
cumulative_energy_exported = await self.read_eem_attribute_expect_success("CumulativeEnergyExported")

self.step("5")
time.sleep(11)
time.sleep(6)

self.step("5a")
cumulative_energy_exported_2 = await self.read_eem_attribute_expect_success("CumulativeEnergyExported")
Expand Down
4 changes: 2 additions & 2 deletions src/python_testing/TC_EEM_2_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def steps_TC_EEM_2_4(self) -> list[TestStep]:
TestStep("4", "Wait 3 seconds"),
TestStep("4a", "TH reads from the DUT the PeriodicEnergyImported attribute",
"Verify the read is successful and note the value read."),
TestStep("5", "Wait 5 seconds"),
TestStep("5", "Wait 3 seconds"),
TestStep("5a", "TH reads from the DUT the PeriodicEnergyImported attribute",
"Verify the read is successful and that the value read has to be different from value measure in step 4a."),
TestStep("6", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEM.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEM.TEST_EVENT_TRIGGER for Stop Fake Readings Test Event."),
Expand All @@ -80,7 +80,7 @@ async def test_TC_EEM_2_4(self):
periodic_energy_imported = await self.read_eem_attribute_expect_success("PeriodicEnergyImported")

self.step("5")
time.sleep(5)
time.sleep(3)

self.step("5a")
periodic_energy_imported_2 = await self.read_eem_attribute_expect_success("PeriodicEnergyImported")
Expand Down
4 changes: 2 additions & 2 deletions src/python_testing/TC_EEM_2_5.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def steps_TC_EEM_2_5(self) -> list[TestStep]:
TestStep("4", "Wait 6 seconds"),
TestStep("4a", "TH reads from the DUT the PeriodicEnergyExported attribute",
"Verify the read is successful and note the value read."),
TestStep("5", "Wait 11 seconds"),
TestStep("5", "Wait 6 seconds"),
TestStep("5a", "TH reads from the DUT the PeriodicEnergyExported attribute",
"Verify the read is successful and that the value read has to be different from value measure in step 4a."),
TestStep("6", "TH sends TestEventTrigger command to General Diagnostics Cluster on Endpoint 0 with EnableKey field set to PIXIT.EEM.TEST_EVENT_TRIGGER_KEY and EventTrigger field set to PIXIT.EEM.TEST_EVENT_TRIGGER for Stop Fake Readings Test Event."),
Expand All @@ -80,7 +80,7 @@ async def test_TC_EEM_2_5(self):
periodic_energy_exported = await self.read_eem_attribute_expect_success("PeriodicEnergyExported")

self.step("5")
time.sleep(11)
time.sleep(6)

self.step("5a")
periodic_energy_exported_2 = await self.read_eem_attribute_expect_success("PeriodicEnergyExported")
Expand Down
6 changes: 3 additions & 3 deletions src/python_testing/TC_EPM_2_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def steps_TC_EPM_2_2(self) -> list[TestStep]:
"Verify the read is successful and that the value is between 3'848 and 4'848 mA. Note the value read."),
TestStep("4c", "TH reads from the DUT the Voltage attribute",
"Verify the read is successful and that the value is between 229'000 and 231'000 mV. Note the value read."),
TestStep("5", "Wait 5 seconds"),
TestStep("5", "Wait 3 seconds"),
TestStep("5a", "TH reads from the DUT the ActivePower attribute",
"Verify the read is successful, that the value is between '980'000 and 1'020'000 mW, and the value is different from the value read in step 4a."),
TestStep("5b", "TH reads from the DUT the ActiveCurrent attribute",
Expand Down Expand Up @@ -105,8 +105,8 @@ async def test_TC_EPM_2_2(self):
voltage = await self.check_epm_attribute_in_range("Voltage", 229000, 231000)

self.step("5")
# After 5 seconds...
time.sleep(5)
# After 3 seconds...
time.sleep(3)

self.step("5a")
# Active power is Mandatory
Expand Down
Loading