Skip to content

Commit

Permalink
Resolve race condition before UserPrompt in simulated tests. (#25576)
Browse files Browse the repository at this point in the history
  • Loading branch information
krypton36 authored and pull[bot] committed Oct 23, 2023
1 parent a3e1dc5 commit 2468792
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/placeholder/linux/include/TestCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ class TestCommand : public TestRunner,
TestCommand * command = reinterpret_cast<TestCommand *>(context);
command->isRunning = true;
command->NextTest();
chip::DeviceLayer::PlatformMgr().RemoveEventHandler(OnPlatformEvent, context);
}

static void OnPlatformEvent(const chip::DeviceLayer::ChipDeviceEvent * event, intptr_t arg)
Expand All @@ -121,6 +120,7 @@ class TestCommand : public TestRunner,
case chip::DeviceLayer::DeviceEventType::kCommissioningComplete:
ChipLogProgress(chipTool, "Commissioning complete");
chip::DeviceLayer::PlatformMgr().ScheduleWork(ScheduleNextTest, arg);
chip::DeviceLayer::PlatformMgr().RemoveEventHandler(OnPlatformEvent, arg);
break;
}
}
Expand All @@ -129,7 +129,7 @@ class TestCommand : public TestRunner,
{
if (commandPath == mCommandPath)
{
NextTest();
chip::DeviceLayer::PlatformMgr().ScheduleWork(ScheduleNextTest, reinterpret_cast<intptr_t>(this));
return;
}

Expand All @@ -141,7 +141,7 @@ class TestCommand : public TestRunner,
{
if (attributePath == mAttributePath)
{
NextTest();
chip::DeviceLayer::PlatformMgr().ScheduleWork(ScheduleNextTest, reinterpret_cast<intptr_t>(this));
return;
}

Expand Down

0 comments on commit 2468792

Please sign in to comment.