tarantool / tarantool/tarantool-python

Ping test fails because of Windows time precision

Open
#214 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug ci
Dominant language
Python
Stars
108
Forks
51
Avg merge
1d 8h
Merged PRs (30d)
1

Description

See https://github.com/tarantool/tarantool-python/pull/213 PR. The issue is as follows: ping test started to fail (in ~70% cases) after I migrated Windows CI 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 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, this StackOverflow answer 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.

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

I see two ways to "solve" this issue:

  • Rework the test, document ping return value precision on Windows.
  • Rework time measurement to be more precise on Windows.

The second approach is more time-consuming and I'm not sure there are any users that really need this to be fixed. So I think it should be the first one until someone interested in the second one appears.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ping test in test/suites/test_dml.py around lines 145-150 and review PR #213 for the Windows CI context. Check how the test measures and asserts the ping result, then determine the documented Windows precision and test behavior needed for a reliable result. Done means the ping test no longer fails because of Windows clock precision and its precision expectations are documented if applicable.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.