Skip to content

Commit

Permalink
test: skip flaky ping test on Windows
Browse files Browse the repository at this point in the history
Ping test started to fail (in ~70% cases) after Windows CI migration
from Appveyor to GitHub Actions. As a part of this migration, the test
tarantool instance was changed from an instance started on a remote
Linux server to an instance started on the same Windows server under
WSL. Thus, request time has shortened and it supposedly caused the ping
test to fail.

Python documentation [1] declares that

  ...though the time is always returned as a floating point number,
  not all systems provide time with a better precision than 1 second...

Particularly, StackOverflow answer [2] argues that

  For Linux and Mac precision is +- 1 microsecond or 0.001 milliseconds.
  Python on Windows uses +- 16 milliseconds precision due to clock
  implementation problems due to process interrupts.

based on Windows documentation [3].

Assuming that ping requests between the same server services can easily
be under 1 ms, it caused the test to fail.

This patch adds skip for the flaky test, refer to #214 for further
development.

1. https://docs.python.org/3/library/time.html#time.time
2. https://stackoverflow.com/a/1938096/11646599
3. https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/high-resolution-timers

Follows up #182, part of #214
  • Loading branch information
DifferentialOrange committed Mar 22, 2022
1 parent 99b84ce commit 93fefbe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/suites/test_dml.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ def test_05_ping(self):
# Simple ping test
# * No exceptions are raised
# * Ping time > 0
if sys.platform.startswith("win"):
self.skipTest("Windows clock precision causes test to fail sometimes, see #214")

self.assertTrue(self.con.ping() > 0)
self.assertEqual(self.con.ping(notime=True), "Success")

Expand Down

0 comments on commit 93fefbe

Please sign in to comment.