From 8544d62220ba94c8c3eaf354c7cba5064f56a9b0 Mon Sep 17 00:00:00 2001 From: odubajDT Date: Tue, 23 Jul 2024 13:38:57 +0200 Subject: [PATCH] fix test Signed-off-by: odubajDT --- receiver/chronyreceiver/internal/chrony/client.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/receiver/chronyreceiver/internal/chrony/client.go b/receiver/chronyreceiver/internal/chrony/client.go index 88e5015d9f42..4ed1ae7486d9 100644 --- a/receiver/chronyreceiver/internal/chrony/client.go +++ b/receiver/chronyreceiver/internal/chrony/client.go @@ -97,8 +97,6 @@ func (c *client) getContext(ctx context.Context) (context.Context, context.Cance if c.timeout == 0 { return context.WithCancel(ctx) } - clock := clockwork.FromContext(ctx) - clock.After(c.timeout) - newCtx := clockwork.AddToContext(ctx, clock) - return context.WithCancel(newCtx) + + return context.WithTimeout(ctx, c.timeout) }