-
Notifications
You must be signed in to change notification settings - Fork 193
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 W3C test service #686
Fix W3C test service #686
Conversation
Attempts to fix the W3C test service by updating usage patterns to match the refactorings and functional changes that have been applied since it was last updated. The effort remains a work-in-progress with the tests failing due to a reason I've been unable to diagnose yet.
You'll need to run a When I pulled down your branch and ran |
I think you'll need to run
On investigating the
UPDATE 1: I've resolved both (1) and (2). |
Codecov Report
@@ Coverage Diff @@
## main #686 +/- ##
============================================
- Coverage 85.00% 82.77% -2.23%
- Complexity 1233 1242 +9
============================================
Files 137 139 +2
Lines 2980 3036 +56
============================================
- Hits 2533 2513 -20
- Misses 447 523 +76
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
f438e31
to
961e58f
Compare
At this point, the test service is running as expected. However all 40 w3c tests are failing, output for all failures from the w3c trace-context test script looks like: <!-- Unsupported carrier type: NULL. Unable to set value associated with key:traceparent (500 Internal Server Error) -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="robots" content="noindex,nofollow" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Unsupported carrier type: NULL. Unable to set value associated with key:traceparent (500 Internal Server Error)</title> @bobstrecansky any ideas to what might be causing this? UPDATE: I recorded the wrong error initially. |
961e58f
to
0eeada3
Compare
I've ironed out issues in the service controller. All tests still fail, I suspect we're doing something wrong within the controller still but I'm not sure. Could use help in diagnosis. |
I replaced deprecated SpanContext::generate() with `SpanContext::createInvalid()`. That didn't look right for obvious reasons, so with this commit it's replaced with a `new Context()`. I'm still not sure if this does the job.
I'm trying to replicate this locally. What commands are you running to see your failures? |
Edit: Sorry, I messed up some syntax in the setup script which got past me since I was running commands directly in a docker container. You should be able to reproduce the issues with the make command now. |
At of dff26c7 the w3c tests are still failing. I'll try to document my interpretation of what's going wrong with these tests in the hope it helps us figure out what it's lacking.
|
I'm able to reproduce your error, and I also get 40 errors. It appears you turned the debug log on, that's a good start. What inconsistencies have you found in the traceparent logic that would cause these errors? Remember, this pulls in the w3c test service here: |
Regarding TestController#L44, this should be: $traceCtxPropagator->inject($headers, null, $context); Some causes for the remaining failures:
|
I think the biggest consistency was discarding the traces the expected by the tests in our response headers to the test harness. Beyond this we still have some more failures to investigate that @Nevay's assessment seems to cover well. As of 4cfc68c, we are passing 30/40 tests. I'm currently investigating the other failures with help from the comments above. |
I think at this point the W3C test service is working fine. The 10 remaining failures we likely owe to not complying with the W3C trace context spec which we could work on outside of this PR.
I tried getting around this by doing a string replacement |
79dcd16
to
77eb918
Compare
Once we get this merged I'll open another PR to factor this to vanilla PHP for speed. |
Now we're down to these 5 failures in this PR. Should we cover them here? /cc @bobstrecansky @tidal |
We should attempt to cover them in this PR if possible. |
-4x failures on the w3c trace context test: - Drop empty tracestates. - Drop the entire tracestate if a member is invalid. - Drop the entire tracestate if member count exceeds max.
7a5fb3f
to
45974a5
Compare
Should be good to go. Please check that the spec compliance changes are at the right place. Thanks |
45974a5
to
8b0bf8a
Compare
Some tests breaking. Will take a look and fix in a while. |
Updated unit tests. edit: and added some additional relevant tests. |
Also fixes now deprecated use of hex2bin on potentially invalid hex strings.
lets get this merged? |
Co-authored-by: Brett McBride <brett.a.mcbride@gmail.com>
Adds a new decorator to extract header sanitization to propagation getter decorator, for servers that concatenate duplicate headers with `;`. Enables this sanitation logic to be used across propagated state.
Attempts to fix the W3C test service by updating usage patterns to match the refactorings and functional changes that have been applied since it was last updated. The effort remains a work-in-progress with the tests failing due to a reason I've been unable to diagnose yet.