Skip to content

Commit

Permalink
Add timeout argument to test command (#15893)
Browse files Browse the repository at this point in the history
The test cluster command in particular is very long and the time
required to run it varies greatly depending on the network setup.
On the M5, we are timing out with the already increased default
value, whereas with a linux device this entire test completes in
less than 10s. Rather than forcing every platform to use the same
default, make the default settable on the command line.

Test: added a log to ensure that the returned GetWaitDuration returns
      the value from the command line. It does, log is removed.
  • Loading branch information
cecille authored and pull[bot] committed Apr 20, 2022
1 parent 87fee8d commit 2257746
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions examples/chip-tool/commands/tests/TestCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,17 @@ class TestCommand : public CHIPCommand,
{
AddArgument("delayInMs", 0, UINT64_MAX, &mDelayInMs);
AddArgument("PICS", &mPICSFilePath);
AddArgument("testTimeoutInS", 0, UINT16_MAX, &mTimeout);
}

~TestCommand(){};

/////////// CHIPCommand Interface /////////
CHIP_ERROR RunCommand() override;
chip::System::Clock::Timeout GetWaitDuration() const override { return chip::System::Clock::Seconds16(kTimeoutInSeconds); }

chip::System::Clock::Timeout GetWaitDuration() const override
{
return chip::System::Clock::Seconds16(mTimeout.ValueOr(kTimeoutInSeconds));
}
virtual void NextTest() = 0;

protected:
Expand Down

0 comments on commit 2257746

Please sign in to comment.