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

clear dstoffset when DSTOffsetRequired is true #28654

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -925,19 +925,24 @@ bool emberAfTimeSynchronizationClusterSetTimeZoneCallback(
}
else
{
TimeState dstState = TimeSynchronizationServer::Instance().UpdateDSTOffsetState();
TimeSynchronizationServer::Instance().ClearDSTOffset();
if (dstState == TimeState::kActive || dstState == TimeState::kChanged)
{
emitDSTStatusEvent(commandPath.mEndpointId, false);
}
response.DSTOffsetRequired = true;
}
}
else
{
response.DSTOffsetRequired = true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This codepath needs to be exercised in a test....

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you mean the DSTOffsetRequired, it's tested in cert tests. If you mean the status event cert test timesync 2.11 should hit this path IIUC the states - it checks for dst status events as the dst goes on and off. To be fair, it's failing currently, but the test exists.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cecille @fessehaeve I mean that we have a code change here, which is fixing an issue, but there are no test changes. That means this code is not being exercised in (automated) tests.

It's possible there are manual cert tests for this, but ideally we would have automated tests here...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gap is not the test, it's the example apps. Static zap means we're not covering all cases in CI. Moving to dynamic app testing would be lovely but is a SDK wide problem

}

if (response.DSTOffsetRequired)
{
TimeState dstState = TimeSynchronizationServer::Instance().UpdateDSTOffsetState();
TimeSynchronizationServer::Instance().ClearDSTOffset();
if (dstState == TimeState::kActive || dstState == TimeState::kChanged)
cecille marked this conversation as resolved.
Show resolved Hide resolved
{
emitDSTStatusEvent(commandPath.mEndpointId, false);
}
}

commandObj->AddResponse(commandPath, response);
return true;
}
Expand Down