On 17.07.23 16:47, Daniel Swarbrick wrote:
>
> But now we get to the ugly stuff. There are several testable examples in
> the client_golang package, which compare the example code's text marshaled
> metrics output to the golden "// Output:" text. As you've probably guessed,
> these now all fail. Even if the golden text were to be updated to the new
> text marshal format, they would still fail *intermittently*, since the
> format is non-deterministic. Some of these tests can be fixed by ensuring
> that the example outputs "compacted" text, using a function such as the
> compact()
> <
https://github.com/golang/protobuf/blob/master/proto/text_test.go>
> function in the legacy protobuf library. Other tests are trickier, because
> they are comparing entire HTTP response bodies, albeit with a protobuf
> error message part way through (which are *also* no longer deterministic).
Hi Daniel, I think your analysis is spot on. For classical text, we
can do stuff do compare in different ways, but for the Go example
tests, we need text output, so we have to do something pretty
involved. (The current way of writing those example tests were really
driven by pragmatism – use the easiest way to got a more or less
readable and deterministic output, and the latter doesn't work
anymore.) Unfortunately, I couldn't come up with any bright ideas for
an easy way out.
Thanks for tackling this.
--
Björn Rabenstein
[PGP-ID] 0x851C3DA17D748D03
[email]
bjo...@rabenste.in