Skip to content

Commit

Permalink
Update integrations/access/pagerduty/testlib/suite.go
Browse files Browse the repository at this point in the history
Co-authored-by: Tiago Silva <[email protected]>
  • Loading branch information
EdwardDowling and tigrato authored Oct 16, 2024
1 parent 24251a1 commit 47743e4
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions integrations/access/pagerduty/testlib/suite.go
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,13 @@ func (s *PagerdutySuiteOSS) TestRecipientsFromAccessMonitoringRule() {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
t.Cleanup(cancel)

ruleName := "test-pagerduty-amr"
lastRuleUpdated := ""
const ruleName = "test-pagerduty-amr"
var collectedNames []string
var mu sync.Mutex
s.appConfig.OnAccessMonitoringRuleCacheUpdateCallback = func(_ types.OpType, name string, _ *accessmonitoringrulesv1.AccessMonitoringRule) error {
lastRuleUpdated = ruleName
mu.Lock()
collectedNames=append(collectedNames, name)
mu.Unlock()
return nil
}
s.startApp()
Expand Down

0 comments on commit 47743e4

Please sign in to comment.