Skip to content

Commit

Permalink
Merge pull request #16067 from aabadie/pr/ci/test-on-iotlab-skip-peri…
Browse files Browse the repository at this point in the history
…ph_timer_periodic

gh_action: exclude tests/periph_timer_periodic from test-on-iotlab
  • Loading branch information
aabadie committed Feb 23, 2021
2 parents ddc5dea + fa32f8a commit 70d746d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/test-on-iotlab.yml
Expand Up @@ -82,6 +82,10 @@ jobs:
# but flashing at a specific offset is not (yet) supported on IoT-LAB
# so it will always fail because of that limitation
APPLICATIONS_EXCLUDE: tests/periph_timer_short_relative_set tests/riotboot
# Increase tolerance error with `tests/periph_timer_periodic` because
# of timing issues with the test script when running in the github
# actions environment
TEST_PERIPH_TIMER_PERIODIC_PRECISION: 0.30
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v2
Expand Down
9 changes: 7 additions & 2 deletions tests/periph_timer_periodic/tests/01-run.py
Expand Up @@ -6,19 +6,24 @@
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.

import os
import sys
import time
from testrunner import run


PRECISION = float(os.getenv("TEST_PERIPH_TIMER_PERIODIC_PRECISION", "0"))


def testfunc(child):
child.expect_exact('TEST START')
start = time.time()
child.expect_exact('TEST SUCCEEDED')
end = time.time()
# test should run 10 cycles with 25ms each
assert (end - start) > 0.25
assert (end - start) < 0.40
elapsed = end - start
assert elapsed > 0.25 * (1 - PRECISION), "=< 0.25s ({})".format(elapsed)
assert elapsed < 0.40 * (1 + PRECISION), "=> 0.40s ({})".format(elapsed)


if __name__ == "__main__":
Expand Down

0 comments on commit 70d746d

Please sign in to comment.