Skip to content

Commit

Permalink
Fixes issue #207 (#216)
Browse files Browse the repository at this point in the history
After adding tracing, it was a wrong assumption to assume that the
X-Deadline was stored as the first entry in a header. Manually removing
the traceparent turns out to be the correct and reliable solution.
  • Loading branch information
hauke76 authored Aug 29, 2023
1 parent 612adc7 commit 998e5ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 0 additions & 2 deletions src/go/cmd/http-relay-server/server/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ go_test(
"server_test.go",
],
embed = [":go_default_library"],
# TODO(https://github.com/googlecloudrobotics/core/issues/207): fix
flaky = True,
visibility = ["//visibility:private"],
deps = [
"//src/proto/http-relay:go_default_library",
Expand Down
9 changes: 8 additions & 1 deletion src/go/cmd/http-relay-server/server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,14 @@ func TestClientHandler(t *testing.T) {
}},
Body: []byte("body"),
}
relayRequest.Header = relayRequest.Header[:1]
// Remove the Traceparent header entry since we cannot assert on its value.
tempHeader := relayRequest.Header[:0]
for _, header := range relayRequest.Header {
if *header.Name != "Traceparent" {
tempHeader = append(tempHeader, header)
}
}
relayRequest.Header = tempHeader
if !proto.Equal(wantRequest, relayRequest) {
t.Errorf("Wrong encapsulated request; want %s; got '%s'", wantRequest, relayRequest)
}
Expand Down

0 comments on commit 998e5ea

Please sign in to comment.