There were several bugs:
1. The @Test annotation on the autoRetryWithTrace test was missing so
that the test wasn't executed.
2. A trace ID is only returned to the client if the request results in
an Internal Server Error, but the test was checking a case where the
request was succeeding due to the retry, hence no trace ID was
returned.
3. In case of Internal Server Error RestApiServlet resets the response
so that a previously set response header with the trace ID was
removed. We must reset the header with the trace ID after the reset
of the response has happened.
4. The test used the Submit REST endpoint, but this REST endpoint has
custom retry logic (it doesn't use RetryingRestModifyView) that
didn't capture and return the trace ID to RestApiServlet yet. Fix
that.
Modifying the return type of Submit#mergeChange(...) is okay, since the
usage at Google doesn't use the return value.
Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I5d21b8ed20cca6ca0915427bb1258a64b33c4637