Skip to content

Commit 3c08445

Browse files
committed
fix_: lint
1 parent 0fc4af3 commit 3c08445

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

node/status_node_services.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,10 @@ func (b *StatusNode) timeSource() *timesource.NTPTimeSource {
583583
b.timeSourceSrvc = timesource.Default()
584584
go func() {
585585
defer common.LogOnPanic()
586-
b.timeSourceSrvc.Start(context.Background())
586+
err := b.timeSourceSrvc.Start(context.Background())
587+
if err != nil {
588+
panic("could not obtain timesource: " + err.Error())
589+
}
587590
}()
588591
}
589592
return b.timeSourceSrvc

timesource/timesource_test.go

+3-5
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,6 @@ func TestSystemTimeChangeDetection(t *testing.T) {
328328
fastNTPSyncPeriod: 1 * time.Hour,
329329
slowNTPSyncPeriod: 1 * time.Hour,
330330
now: mockTimeNow,
331-
quit: make(chan struct{}),
332331
}
333332

334333
// Set up the timeQuery function to track calls
@@ -446,18 +445,17 @@ func TestTimeTrackingInitialization(t *testing.T) {
446445
slowNTPSyncPeriod: 1 * time.Hour,
447446
timeQuery: mockQuery,
448447
now: mockTimeNow,
449-
quit: make(chan struct{}),
450448
}
451449

452450
// Verify that time tracking fields are initially zero
453451
assert.True(t, ts.lastMonotonic.IsZero(), "lastMonotonic should be zero before Start()")
454452

455453
// Start the time source
456-
ts.Start()
454+
err := ts.Start(context.TODO())
455+
assert.NoError(t, err, "Start should not return an error")
457456

458457
defer func() {
459-
err := ts.Stop()
460-
assert.NoError(t, err, "Stop should not return an error")
458+
ts.Stop()
461459
}()
462460

463461
// Verify that time tracking fields are initialized

0 commit comments

Comments
 (0)