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

go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue TestLastValueMerge failure #1578

Closed
MrAlias opened this issue Feb 24, 2021 · 0 comments · Fixed by #1579
Closed

go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue TestLastValueMerge failure #1578

MrAlias opened this issue Feb 24, 2021 · 0 comments · Fixed by #1579
Assignees
Labels
bug Something isn't working
Milestone

Comments

@MrAlias
Copy link
Contributor

MrAlias commented Feb 24, 2021

Running the test suite on Windows amd64 for both Go 1.15 and 1.14:

--- FAIL: TestLastValueMerge (0.00s)
    --- FAIL: TestLastValueMerge/Int64Kind (0.00s)
        lastvalue_test.go:116: 
            	Error Trace:	lastvalue_test.go:116
            	            				test.go:75
            	Error:      	Should be true
            	Test:       	TestLastValueMerge/Int64Kind
    --- FAIL: TestLastValueMerge/Float64Kind (0.00s)
        lastvalue_test.go:116: 
            	Error Trace:	lastvalue_test.go:116
            	            				test.go:75
            	Error:      	Should be true
            	Test:       	TestLastValueMerge/Float64Kind
FAIL
FAIL	go.opentelemetry.io/otel/sdk/metric/aggregator/lastvalue	0.030s

Looking at the code

func TestLastValueMerge(t *testing.T) {
aggregatortest.RunProfiles(t, func(t *testing.T, profile aggregatortest.Profile) {
agg1, agg2, ckpt1, ckpt2 := new4()
descriptor := aggregatortest.NewAggregatorTest(metric.ValueObserverInstrumentKind, profile.NumberKind)
first1 := profile.Random(+1)
first2 := profile.Random(+1)
first1.AddNumber(profile.NumberKind, first2)
aggregatortest.CheckedUpdate(t, agg1, first1, descriptor)
aggregatortest.CheckedUpdate(t, agg2, first2, descriptor)
require.NoError(t, agg1.SynchronizedMove(ckpt1, descriptor))
require.NoError(t, agg2.SynchronizedMove(ckpt2, descriptor))
checkZero(t, agg1)
checkZero(t, agg2)
_, t1, err := ckpt1.LastValue()
require.Nil(t, err)
_, t2, err := ckpt2.LastValue()
require.Nil(t, err)
require.True(t, t1.Before(t2))
aggregatortest.CheckedMerge(t, ckpt1, ckpt2, descriptor)
lv, ts, err := ckpt1.LastValue()
require.Nil(t, err)
require.Equal(t, t2, ts, "Merged timestamp - non-monotonic")
require.Equal(t, first2, lv, "Merged value - non-monotonic")
})
}

Again this looks like we need to add an artificial delay to ensure the checkpoint doesn't happen with the same timestamp.

@MrAlias MrAlias added the bug Something isn't working label Feb 24, 2021
@MrAlias MrAlias self-assigned this Feb 24, 2021
@pellared pellared added this to the untracked milestone Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants