diff --git a/domains/amazon/mock.go b/domains/amazon/mock.go index 6300efb..ae18e07 100644 --- a/domains/amazon/mock.go +++ b/domains/amazon/mock.go @@ -217,7 +217,11 @@ func (m *Mocks) listenForNotifications(ctx context.Context) (<-chan struct{}, <- return fmt.Errorf("error occurred while waiting for the next notification: %w", err) } - ch <- struct{}{} + select { + case ch <- struct{}{}: + case <-ctx.Done(): + return nil + } } }()