fix(zipkin): avoid getting a nil value in log phase(#10590)#10666
Conversation
| --- more_headers | ||
| b3: abc | ||
| --- no_error_log | ||
| [error] No newline at end of file |
There was a problem hiding this comment.
u can insert a new line at here to help the ci works
There was a problem hiding this comment.
@Vacant2333
my new test cast as following:
=== TEST 23: no error in log phase while b3 header invalid
--- request
GET /echo
--- more_headers
b3: 80f198ee56343ba864fe8b2a57d3eff7
--- response_headers
x-b3-sampled:
--- error_code: 400
--- grep_error_log eval
qr/attempt to index local 'opentracing' \(a nil value\)
--- grep_error_log_out
i want to assert that there is no corresponding error in the log, what should I do?
There was a problem hiding this comment.
u may need to try this https://apisix.apache.org/docs/apisix/internal/testing-framework/#executing-shell-commands, im not sure if it will works🤣, i didnt find some testcase need to do like u want
There was a problem hiding this comment.
i want to assert that there is no corresponding error in the log, what should I do?
You can use no_error_log https://github.com/apache/apisix/blob/master/docs/en/latest/plugin-develop.md?plain=1#L549
There was a problem hiding this comment.
i want to assert that there is no corresponding error in the log, what should I do?
You can use
no_error_loghttps://github.com/apache/apisix/blob/master/docs/en/latest/plugin-develop.md?plain=1#L549
there is a error in rewrite phase, but no error in log phase.
Description
An error(attempt to index local 'opentracing' (a nil value)) occurs in the following situations:
All of the above result in a not being assigned value to ctx.opentracing. so got a error in log phase. this pr will fix it.
Fixes #10590
Checklist