open-traffic-generator/snappi

GoSnappi HTTP: Deep comparison of gosnappi constructs fail even though content/type of compare-inputs are same

Opened this issue · 0 comments

This issue is identified while integrating with Gosnappi HTTP Server implementation.
https://github.com/open-traffic-generator/snappi/tree/gosnappi_server_tmp/gosnappi

If we want to deep compare instances of same objects [e.g. comparing Metrics() of 2 flows with identical content],

reflect.DeepEqual(f1.Metrics().Msg(), f2.Metrics().Msg())

the comparison fails.

Although, just before the comparison, if we just add the following lines, comparison succeeds,

f1.Metrics().ToJson()
f2.Metrics().ToJson()

which leads to a thought that,

  • certain objects/constructs (although, none found visually during debugging) are not set to defaults.
  • ToJson() is enabling the same.