Skip to content

Commit

Permalink
[chore] Fix TestPerfCounter_Reset test (open-telemetry#36726)
Browse files Browse the repository at this point in the history
#### Description

Fix the TestPerfCounter_Reset that is failing consistently. 

```terminal
=== FAIL: . TestPerfCounter_Reset (0.00s)
    watcher_test.go:131: 
        	Error Trace:	D:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/pkg/winperfcounters/watcher_test.go:131
        	Error:      	Both arguments must be pointers
        	Test:       	TestPerfCounter_Reset
```

Root case: after upgrading `testify` circa of 2 weeks ago, since it
included:

> NotSame should fail if args are not pointers
stretchr/testify#1661 by @sikehish in
stretchr/testify#1664

See https://github.com/stretchr/testify/releases

#### Testing

Local test run

Co-authored-by: Antoine Toulme <atoulme@splunk.com>
  • Loading branch information
2 people authored and AkhigbeEromo committed Jan 13, 2025
1 parent e6154c2 commit a723578
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/winperfcounters/watcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func TestPerfCounter_Reset(t *testing.T) {

// new query is different instance of same counter.
require.NoError(t, err)
assert.NotSame(t, handle, pc.handle)
assert.NotEqual(t, handle, pc.handle)
assert.NotSame(t, query, pc.query)
assert.Equal(t, path, pc.Path())

Expand Down

0 comments on commit a723578

Please sign in to comment.