Skip to content

Discard earliest heartbeat once there are 30 heartbeats #8724

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

Merged
merged 6 commits into from
Jan 27, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix test names
  • Loading branch information
dlarocque committed Jan 23, 2025
commit a26157988c7b442c5a1770f1e7e5ea0957256128
4 changes: 2 additions & 2 deletions packages/app/src/heartbeatService.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ describe('HeartbeatServiceImpl', () => {
const emptyHeaders = await heartbeatService.getHeartbeatsHeader();
expect(emptyHeaders).to.equal('');
});
it('triggerHeartbeat() removes the earliest heartbeat once it exceeds the max number of heartbeats', async () => {
it('triggerHeartbeat() removes the earliest heartbeat once the max number of heartbeats is exceeded', async () => {
// Trigger heartbeats until we reach the limit
const numHeartbeats =
heartbeatService._heartbeatsCache?.heartbeats.length!;
Expand All @@ -295,7 +295,7 @@ describe('HeartbeatServiceImpl', () => {
heartbeatService._heartbeatsCache?.heartbeats.indexOf(earliestHeartbeat)
).to.equal(-1);
});
it('triggerHeartbeat() never exceeds max heartbeats', async () => {
it('triggerHeartbeat() never causes the heartbeat count to exceed the max', async () => {
for (let i = 0; i <= 50; i++) {
await heartbeatService.triggerHeartbeat();
clock.tick(24 * 60 * 60 * 1000);
Expand Down
Loading