osmosis icon indicating copy to clipboard operation
osmosis copied to clipboard

test(twap): unchecked test result

Open pysel opened this issue 1 year ago • 1 comments

Background

Result of https://github.com/osmosis-labs/osmosis/blob/main/x/twap/api_test.go#L899-L904 supposedly should be checked, but it is not at the moment (context: https://github.com/osmosis-labs/osmosis/pull/6336#issuecomment-1711432231)

I tried to assert the result of this comparison, it led to a failed test

Suggested Design

  • add check that the output is 0 (aka compared values are within error tolerance)
  • fix test if it breaks it

Acceptance Criteria

result checked, test passes

pysel avatar Sep 09 '23 11:09 pysel

@pysel there will always be 95 times in 200 retries that CompareBigDec will not be in range of tolerance with ErrTolerance MultiplicativeTolerance set to SmallestDec, at least that's for my computer. it work fine with MultiplicativeTolerance set to osmomath.SmallestBigDec().Dec() though. My conclusion is we need to loosen the MultiplicativeTolerance and it will pass.

hoangdv2429 avatar Oct 14 '23 19:10 hoangdv2429