Module: tools Branch: master Commit: 30c30200c7caff683b0c93455212d4390dd0137e URL: https://source.winehq.org/git/tools.git/?a=commit;h=30c30200c7caff683b0c9345...
Author: Francois Gouget fgouget@codeweavers.com Date: Tue Sep 17 12:35:15 2019 +0200
testbot/Engine: Ignore ChildPid & ChildDeadline for maintenance VMs.
For debugging it is useful to set a VM in maintenance mode and then manually run scripts operating on that VM. When doing so ChildPid is undefined since it is normally set by the Engine when starting the script. But the scripts may modify other VM fields, including ChildDeadline. But when the Scheduler sees such a 'left-over' ChildDeadline field it normally marks the VM as dirty and powers it off, thus interfering with the script being tested. So modify the Scheduler to ignore ChildDeadline for maintenance VMs whether for cleanup or to compute when to reschedule next.
Signed-off-by: Francois Gouget fgouget@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
testbot/lib/WineTestBot/Engine/Scheduler.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/testbot/lib/WineTestBot/Engine/Scheduler.pm b/testbot/lib/WineTestBot/Engine/Scheduler.pm index 3ec51d2..569dff7 100644 --- a/testbot/lib/WineTestBot/Engine/Scheduler.pm +++ b/testbot/lib/WineTestBot/Engine/Scheduler.pm @@ -350,8 +350,13 @@ sub _CheckAndClassifyVMs() } else { - if (defined $VM->ChildPid or defined $VM->ChildDeadline or - $VM->Status =~ /^(?:running|reverting|sleeping)$/) + if ($VM->Status eq "maintenance") + { + # Don't touch the VM while the administrator is working on it + $Sched->{busyvms}->{$VMKey} = 1; + } + elsif (defined $VM->ChildPid or defined $VM->ChildDeadline or + $VM->Status =~ /^(?:running|reverting|sleeping)$/) { # The VM is missing its child process or it died unexpectedly. Mark # the VM dirty so a revert or shutdown brings it back to a known state. @@ -381,11 +386,6 @@ sub _CheckAndClassifyVMs() # Ignore the VM for this round since we cannot use it $Sched->{busyvms}->{$VMKey} = 1; } - elsif ($VM->Status eq "maintenance") - { - # Don't touch the VM while the administrator is working on it - $Sched->{busyvms}->{$VMKey} = 1; - } elsif ($VM->Status ne "off") { LogMsg "Unexpected $VMKey status ". $VM->Status ."\n"; @@ -1025,7 +1025,7 @@ sub ScheduleJobs() $VMs->FilterEnabledRole(); foreach my $VM (@{$VMs->GetItems()}) { - if (defined $VM->ChildDeadline and + if ($VM->Status ne "maintenance" and defined $VM->ChildDeadline and (!defined $FirstDeadline or $VM->ChildDeadline < $FirstDeadline)) { $FirstDeadline = $VM->ChildDeadline;