Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[connector/spanmetrics] Unit test failures #33438

Closed
crobert-1 opened this issue Jun 7, 2024 · 5 comments · Fixed by #33443
Closed

[connector/spanmetrics] Unit test failures #33438

crobert-1 opened this issue Jun 7, 2024 · 5 comments · Fixed by #33443

Comments

@crobert-1
Copy link
Member

Component(s)

connector/spanmetrics

Describe the issue you're reporting

Failing CI/CD link

The failure occurred on Windows, so it may be Windows-related. Looks like these tests were just added a few days ago in #31780.

Failure output:

Running target 'test' in module 'connector/spanmetricsconnector' as part of group 'connector'
C:/mingw64/bin/make --no-print-directory -C connector/spanmetricsconnector test
D:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/.tools/gotestsum --rerun-fails=1 --packages="./..." -- -race -timeout 600s -parallel 4 --tags=""
✓  . (26.363s)

DONE 23 tests in 315.093s
✖  . (1.063s)
✓  internal/cache (1.082s)
✓  internal/metrics (1.38s)
✓  internal/metadata (1.38s)

DONE 139 tests, 2 failures in 7.902s

✖  . (67ms)
✖  . (86ms)

=== Failed
=== FAIL: . TestTimestampsForUninterruptedStream (0.00s)
    connector_test.go:1656: 
        	Error Trace:	D:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/connector/spanmetricsconnector/connector_test.go:1656
        	            				D:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/connector/spanmetricsconnector/connector_test.go:1714
        	Error:      	"2024-06-07 19:26:22.3735801 +0000 UTC" is not greater than "2024-06-07 19:26:22.3735801 +0000 UTC"
        	Test:       	TestTimestampsForUninterruptedStream
--- PASS: TestTimestampsForUninterruptedStream/AGGREGATION_TEMPORALITY_CUMULATIVE (0.00s)
--- PASS: TestTimestampsForUninterruptedStream/AGGREGATION_TEMPORALITY_DELTA (0.00s)

=== FAIL: . TestDeltaTimestampCacheExpiry (0.00s)
    connector_test.go:1837: 
        	Error Trace:	D:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/connector/spanmetricsconnector/connector_test.go:1837
        	Error:      	"2024-06-07 19:26:22.37[649](https://github.com/open-telemetry/opentelemetry-collector-contrib/actions/runs/9421967762/job/25957203925?pr=33434#step:6:650)67 +0000 UTC" is not greater than "2024-06-07 19:26:22.3764967 +0000 UTC"
        	Test:       	TestDeltaTimestampCacheExpiry

=== FAIL: . TestTimestampsForUninterruptedStream (re-run 1) (0.01s)
    connector_test.go:1665: 
        	Error Trace:	D:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/connector/spanmetricsconnector/connector_test.go:1665
        	            				D:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/connector/spanmetricsconnector/connector_test.go:1714
        	Error:      	"2024-06-07 19:26:26.0388037 +0000 UTC" is not greater than "2024-06-07 19:26:26.0388037 +0000 UTC"
        	Test:       	TestTimestampsForUninterruptedStream
--- PASS: TestTimestampsForUninterruptedStream/AGGREGATION_TEMPORALITY_CUMULATIVE (0.00s)
--- PASS: TestTimestampsForUninterruptedStream/AGGREGATION_TEMPORALITY_DELTA (0.00s)

=== FAIL: . TestDeltaTimestampCacheExpiry (re-run 1) (0.00s)
    connector_test.go:1837: 
        	Error Trace:	D:/a/opentelemetry-collector-contrib/opentelemetry-collector-contrib/connector/spanmetricsconnector/connector_test.go:1837
        	Error:      	"2024-06-07 19:26:29.1194793 +0000 UTC" is not greater than "2024-06-07 19:26:29.1194793 +0000 UTC"
        	Test:       	TestDeltaTimestampCacheExpiry

DONE 2 runs, 143 tests, 4 failures in 14.054s
@crobert-1 crobert-1 added the needs triage New item requiring triage label Jun 7, 2024
Copy link
Contributor

github-actions bot commented Jun 7, 2024

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@crobert-1
Copy link
Member Author

Removing needs triage based on the submitted PR

dmitryax pushed a commit that referenced this issue Jul 2, 2024
…es on timing (#33443)

**Description:** <Describe what has changed.>
Tries fixing some flaky unit tests that relied on `time.Now()` always
returning a higher value than the previous call

The solution is reading the current time from a `clock.Clock` interface.
The test relying on ever-increasing `Now()` values uses a mock that
always returns an increasing value.

**Link to tracking Issue:** #33438

**Testing:**
- Ran the component locally to verify the ticker still flushes after the
configured duration passes

Closes #33438
cparkins pushed a commit to AmadeusITGroup/opentelemetry-collector-contrib that referenced this issue Jul 11, 2024
…es on timing (open-telemetry#33443)

**Description:** <Describe what has changed.>
Tries fixing some flaky unit tests that relied on `time.Now()` always
returning a higher value than the previous call

The solution is reading the current time from a `clock.Clock` interface.
The test relying on ever-increasing `Now()` values uses a mock that
always returns an increasing value.

**Link to tracking Issue:** open-telemetry#33438

**Testing:**
- Ran the component locally to verify the ticker still flushes after the
configured duration passes

Closes open-telemetry#33438
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants