tarantool / tarantool/tarantool-python

Ping test fails because of Windows time precision

Aperta
#214 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug ci
Lingua principale
Python
Stelle
108
Fork
51
Merge medio
1g 8h
PR unite (30g)
1

Descrizione

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.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con il test del ping in test/suites/test_dml.py intorno alle righe 145-150 e consulta PR #213 per il contesto di Windows CI. Verifica come il test misura e asserisce il risultato del ping, quindi determina la precisione documentata di Windows e il comportamento del test necessario per ottenere un risultato affidabile. Il lavoro è completato quando il test del ping non fallisce più a causa della precisione dell’orologio di Windows e le relative aspettative di precisione sono documentate, se applicabile.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
testing-qa
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.