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

[hotfix] Fix test failure. #12845

Merged
merged 1 commit into from
Dec 9, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions src/controller/python/test/test_scripts/cluster_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,6 @@ async def SendCommandWithResponse(cls, devCtrl):
if res.returnValue != 5:
raise ValueError()

@classmethod
async def SendCommandWithTestClusterEventTrigger(cls, devCtrl, eventNumber):
req = Clusters.TestCluster.Commands.TestEmitTestEventRequest(arg1=1)
res = await devCtrl.SendCommand(nodeid=NODE_ID, endpoint=LIGHTING_ENDPOINT_ID, payload=req)
if not isinstance(res, Clusters.TestCluster.Commands.TestEmitTestEventResponse):
logger.error(f"Unexpected response of type {type(res)} received.")
raise ValueError()
logger.info(f"Received response: {res}")
if res.value != eventNumber:
raise ValueError()

@classmethod
async def SendWriteRequest(cls, devCtrl):
res = await devCtrl.WriteAttribute(nodeid=NODE_ID,
Expand Down Expand Up @@ -222,10 +211,12 @@ async def TestReadAttributeRequests(cls, devCtrl):
raise AssertionError("Unexpected read result")

async def TriggerAndWaitForEvents(cls, devCtrl, req):
# We trigger sending an event a couple of times just to be safe.
res = await devCtrl.SendCommand(nodeid=NODE_ID, endpoint=1, payload=Clusters.TestCluster.Commands.TestEmitTestEventRequest())
res = await devCtrl.SendCommand(nodeid=NODE_ID, endpoint=1, payload=Clusters.TestCluster.Commands.TestEmitTestEventRequest())
res = await devCtrl.SendCommand(nodeid=NODE_ID, endpoint=1, payload=Clusters.TestCluster.Commands.TestEmitTestEventRequest())

# Events may take some time to flush, so wait for about 10s or so to get some events.
for i in range(0, 10):
print("Reading out events..")
res = await devCtrl.ReadEvent(nodeid=NODE_ID, events=req)
Expand Down Expand Up @@ -276,9 +267,6 @@ async def RunTest(cls, devCtrl):
await cls.RoundTripTest(devCtrl)
await cls.RoundTripTestWithBadEndpoint(devCtrl)
await cls.SendCommandWithResponse(devCtrl)
await cls.SendCommandWithTestClusterEventTrigger(devCtrl, 1)
await cls.TestReadEventRequests(devCtrl, 1)
await cls.SendCommandWithTestClusterEventTrigger(devCtrl, 2)
await cls.TestReadEventRequests(devCtrl, 1)
await cls.SendWriteRequest(devCtrl)
await cls.TestReadAttributeRequests(devCtrl)
Expand Down