Skip to content

Commit 1cb5438

Browse files
committed
adds error just to have test coverage also
1 parent d68059b commit 1cb5438

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/tagit/tagit_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -738,6 +738,9 @@ func TestRun(t *testing.T) {
738738
MockAgent: &MockAgent{
739739
ServicesFunc: func() (map[string]*api.AgentService, error) {
740740
updateServiceTagsCalled.Add(1)
741+
if updateServiceTagsCalled.Load() == 2 {
742+
return nil, fmt.Errorf("enter error")
743+
}
741744
return map[string]*api.AgentService{
742745
"test-service": {
743746
ID: "test-service",
@@ -758,7 +761,7 @@ func TestRun(t *testing.T) {
758761
go tagit.Run(ctx)
759762

760763
// Allow some time to pass and then cancel the context
761-
time.Sleep(250 * time.Millisecond) // Adjust this duration as needed
764+
time.Sleep(350 * time.Millisecond) // Adjust this duration as needed
762765
cancel()
763766

764767
// Allow some time for the goroutine to react to the context cancellation

0 commit comments

Comments
 (0)