Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/test-driver: Use guest time when using sleep #96571

Merged
merged 1 commit into from Aug 29, 2020

Conversation

aszlig
Copy link
Member

@aszlig aszlig commented Aug 28, 2020

With the Perl driver, machine.sleep(N) was doing a sleep on the guest machine instead of the host machine. The new Python test driver however uses time.sleep(), which instead sleeps on the host.

While this shouldn't make a difference most of the time, it does however make a huge difference if the test machine is loaded and you're sleeping for a minimum duration of eg. an animation.

I stumbled on this while porting most of all my tests to the new Python test driver and particularly my video game tests failed on a fairly loaded machine, whereas they don't with the Perl test driver.

Switching the sleep() method to sleep on the guest instead of the host fixes this.

With the Perl driver, machine.sleep(N) was doing a sleep on the guest
machine instead of the host machine. The new Python test driver however
uses time.sleep(), which instead sleeps on the host.

While this shouldn't make a difference most of the time, it *does*
however make a huge difference if the test machine is loaded and you're
sleeping for a minimum duration of eg. an animation.

I stumbled on this while porting most of all my tests to the new Python
test driver and particularily my video game tests failed on a fairly
loaded machine, whereas they don't with the Perl test driver.

Switching the sleep() method to sleep on the guest instead of the host
fixes this.

Signed-off-by: aszlig <aszlig@nix.build>
@flokli flokli merged commit c376f3e into NixOS:master Aug 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants