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

Fix Heartbeat Interval #1979

Merged
merged 4 commits into from
Aug 3, 2020
Merged

Fix Heartbeat Interval #1979

merged 4 commits into from
Aug 3, 2020

Conversation

TimothyMothra
Copy link
Member

@TimothyMothra TimothyMothra commented Jul 30, 2020

Fixes issue of heartbeat interval not applying immediately when changed.
#1298

Changes

  • setting the heartbeat interval will now reset the timer.

Checklist

  • I ran Unit Tests locally.
  • CHANGELOG.md updated with one line description of the fix, and a link to the original issue if available.

For significant contributions please make sure you have completed the following items:

  • Design discussion issue #
  • Changes in public surface reviewed

The PR will trigger build, unit tests, and functional tests automatically. Please follow these instructions to build and test locally.

Notes for authors:

  • FxCop and other analyzers will fail the build. To see these errors yourself, compile localy using the Release configuration.

Notes for reviewers:

  • We support comment build triggers
    • /AzurePipelines run will queue all builds
    • /AzurePipelines run <pipeline-name> will queue a specific build

@@ -49,7 +49,7 @@ public bool IsHeartbeatEnabled
}

/// <summary>
/// Gets or sets the delay interval between heartbeats.
/// Gets or sets the delay interval between heartbeats. Setting this value will immediately reset the heartbeat timer.
Copy link
Contributor

Choose a reason for hiding this comment

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

any way to unit test this change?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm thinking about this now. I'm reviewing our existing unit test coverage. Unit tests are passing locally, but I wanted this to run on our build server to confirm that all our integration tests still pass.

Copy link
Member Author

Choose a reason for hiding this comment

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

The System.Threading.Timer is not easily testable. This timer doesn't expose the Interval property so can't inspect that it was changed.

We don't have proper test coverage of how heartbeats are created.
I think we would need to do some significant refactoring of this class so we can manually invoke a "timer event" and validate the telemetry that gets created.
I think that's out of scope for this PR.

I propose that we take these changes as-is and revisit this later.

@TimothyMothra TimothyMothra merged commit e608104 into develop Aug 3, 2020
@TimothyMothra TimothyMothra deleted the tilee/heartbeatinterval branch August 3, 2020 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

First heartbeat sent after 15 minutes instead of configured interval
3 participants