-
Notifications
You must be signed in to change notification settings - Fork 592
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
fix: test failure cases on windows #1047
Conversation
The DataDog test failure seems to be caused by the default service name being |
190b194
to
355398d
Compare
thx, I think I found the answer here 😃 https://github.com/open-telemetry/opentelemetry-go/blob/v1.0.0-RC2/semconv/v1.4.0/resource.go#L785 |
2b7bd82
to
b296754
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice 👍
b296754
to
bac4231
Compare
@Aneurysm9 pls review again 🙃 |
f1228dc
to
fe5d241
Compare
accdfa7
to
072939c
Compare
=== RUN TestHostNetwork
assertion_compare.go:342:
Error Trace: host_test.go:235
Error: "10000" is not less than or equal to "7837"
Test: TestHostNetwork
Messages: []
--- FAIL: TestHostNetwork This mistake was accidental and increasing sleep can only improve the chances of success, any ideas to help? on windows |
@Aneurysm9 I used the following method to debug and the test passed in 3s/8s/10s ... etc, so I can't use sleep to guarantee the success of the test, do you think it's reasonable to wait for sent/recv Is it reasonable to wait until sent/recv is satisfied until the go test times out? opentelemetry-go-contrib/instrumentation/host/host_test.go Lines 222 to 223 in 8e44f3f
opentelemetry-go-contrib/instrumentation/host/host_test.go Lines 222 to 232 in 330ca09
|
At first glance it looks like a good candidate to use |
Of course, but how long should we wait ? as this process seems very unstable on Windows 🤔 |
I would try max 30s - should be long enough I guess 😉 intervals one or half of a second? |
330ca09
to
f7764b4
Compare
@pellared Thank you for your help 👍 |
return uint64(howMuch) <= hostAfter[0].BytesSent-hostBefore[0].BytesSent && | ||
uint64(howMuch) <= hostAfter[0].BytesRecv-hostBefore[0].BytesRecv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you keep these as assertions? Doing so should help in understanding where a failure occurred if this test starts failing in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Aneurysm9
Because it is necessary to wait for BytesSent
and BytesRecv
all the time, they are not assert here.
There should only be one timeout error here and it will be tracked to the require.Eventually
line, but 30 seconds will cause the go test to time out without printing the error tracking message, so consider updating it to <30 seconds?
#1047 (comment) The idea. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the error trace info for the 20s timeout
=== RUN TestHostNetwork
host_test.go:222:
Error Trace: host_test.go:222
Error: Condition never satisfied
Test: TestHostNetwork
--- FAIL: TestHostNetwork (20.00s)
pusher := controller.New(processor, controller.WithExporter(exp), controller.WithCollectPeriod(time.Second*10)) | ||
pusher := controller.New(processor, controller.WithExporter(exp), controller.WithCollectPeriod(time.Second*10), | ||
controller.WithResource(resource.Default()), | ||
controller.WithResource(resource.NewSchemaless(semconv.ServiceNameKey.String("ExampleExporter")))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this use New()
instead of NewSchemaless()
? We have a schema from semconv.SchemaURL
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @Aneurysm9
Okey! like this?
ctx := context.Background()
serviceName, err := resource.New(ctx, resource.WithAttributes(semconv.ServiceNameKey.String("ExampleExporter")))
if err != nil {
panic(err)
}
cont := controller.New(processor, controller.WithExporter(exp), controller.WithCollectPeriod(time.Second*10),
controller.WithResource(resource.Default()), controller.WithResource(serviceName))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please merge in main to resolve some conflicts?
Other than the outstanding comments it LGTM
5edf45d
to
cacb124
Compare
cacb124
to
ca6b0a3
Compare
@MadVikingGod Done |
Fixed #1010
But it's not clear what the problem is herehttps://github.com/laojianzi/opentelemetry-go-contrib/runs/3504741867?check_suite_focus=true#step:6:297
Resolved in #1047 (comment)