]> granicus.if.org Git - esp-idf/commit
esp_timer: fix occasional failures in "monotonic values" test
authorIvan Grokhotkov <ivan@espressif.com>
Fri, 22 Feb 2019 13:27:43 +0000 (21:27 +0800)
committerIvan Grokhotkov <ivan@espressif.com>
Thu, 28 Feb 2019 13:58:03 +0000 (21:58 +0800)
commit70a9e72e06ea493c221e8c2bd058374362841fc8
tree637793ca3db488e9573c7bf714c895d31bcbbfb3
parent9cfd94a9d6d8d79b4baa27d56f0d3cc28c9f3ce5
esp_timer: fix occasional failures in "monotonic values" test

1. ref_clock used in unit tests occasionally produces time off by ~100
microseconds shortly after being started. Add a delay to let
ref_clock stabilise, until the cause is found.

2. Reduce roundoff error accumulation which would occasionally cause
the test to fail, by choosing an overflow value which can be divided
by APB frequency.

3. Move time sampling part of the test into an IRAM function to
reduce variations due to cache behavior.

4. Remove calculation of "standard deviation" in the test, as what was
calculated was not actually standard deviation, and it did not add any
useful information.
components/esp32/esp_timer_esp32.c
components/esp32/test/test_esp_timer.c
tools/unit-test-app/components/unity/ref_clock.c