tarantool / metrics

Metric collection library for Tarantool
MIT License
39 stars 23 forks source link

test: stable latency asserts #423

Closed DifferentialOrange closed 1 year ago

DifferentialOrange commented 1 year ago

fiber.sleep(time) does not guarantee that the control would be returned after that exact time. Current latency measurement test relies on assumption that application is not that busy and every other thing should fit into 10 ms margin. It makes the test potentially flaky (it had failed for me once when I've run it with test-run framework [1]). After this patch test asserts that measured latency is not less than the actual time of sleep and not greater than the time of test execution, using the same tool to measure time everywhere. This approach should not depend on system and application load.

  1. https://github.com/tarantool/test-run

What has been done? Why? What problem is being solved?

I didn't forget about

Part of tarantool/tarantool#7725