Project

General

Profile

action #116554

Updated by mkittler about 2 years ago

## Motivation 
 We have multiple places in os-autoinst where we consider a "no_wait" scenario but use different sleeping times, e.g. 0.01s in https://github.com/os-autoinst/os-autoinst/pull/2109/files vs. 0.1s in https://github.com/os-autoinst/os-autoinst/pull/2164/files#diff-ee84fe6541d1e2e971e9e0d4bf0187272df8fa4ac878d033b1c8c600325e9f6dR185 . We should better avoid magic numbers with inconsistent usage for the same 

 ## Acceptance criteria 
 * **AC1:** We only use one common definition 

 ## Suggestions 
 * Review occurences from `$ git grep '\(sleep\|interval\).*\.0\?1'` related to sleeping between test API checks 
 … 
 backend/baseclass.pm:          # note: Still keeping the interval at 0.1 s to avoid wasting too much CPU (corresponding to what check_screen/assert_screen 
 backend/baseclass.pm:          my @additional_intervals = $wait_screen_change && $wait_screen_change->{no_wait} ? (0.1) : (); 
 … 
 testapi.pm:          sleep($args{no_wait} ? 0.01 : 0.5); 
 ``` 
 there might be an additional 0.1s somewhere in isotovideo that mkittler mentioned. At best we can define the number with 0.01 consistently in a single place and use from there following up with what https://github.com/os-autoinst/os-autoinst/pull/2109/files#diff-3420c7e01f73caee7d97053af39990e3297daf42d06e0fc8848f78af1a5e009eR565 tried to do already. 
 * **But please also read #116554#note-2** because I must say that the ticket description is misleading/problematic as-is.

Back