Skip to content

Commit f901f2c

Browse files
[chore][sqlserver/receiver] Correct 'CompareMetrics' parameters order (open-telemetry#41209)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description The `pmetrictest.CompareMetrics` function expects expected metrics first and actual metrics second. However, in the SQL Server receiver tests, the arguments are reversed — actual metrics are passed first, and expected metrics second. This causes confusing test failure messages, such as: number of metrics doesn't match expected: `47`, actual: `46` — when in reality, the actual metrics are `47` and the expected are `46`.
1 parent 5534fd6 commit f901f2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

receiver/sqlserverreceiver/scraper_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ func TestSuccessfulScrape(t *testing.T) {
173173
expectedMetrics, err := golden.ReadMetrics(expectedFile)
174174
assert.NoError(t, err)
175175

176-
assert.NoError(t, pmetrictest.CompareMetrics(actualMetrics, expectedMetrics,
176+
assert.NoError(t, pmetrictest.CompareMetrics(expectedMetrics, actualMetrics,
177177
pmetrictest.IgnoreMetricDataPointsOrder(),
178178
pmetrictest.IgnoreStartTimestamp(),
179179
pmetrictest.IgnoreTimestamp(),

0 commit comments

Comments
 (0)