action #10534
closed
wait_serial fails to match special string in serial console occasionally
Added by jtzhao about 9 years ago.
Updated over 8 years ago.
Category:
Feature requests
From the logfiles it looks like you are running type_string and wait_serial manually. It might be (I don't know if this makes sense) that the type_string output shows up in the "serial console output" but wait_serial can not catch it. Did you try "assert_script_run" instead? From the logs it gives many warnings so your machine might be really slow and therefore having timing issues.
Thanks for replying. Actually I ran "script_output" instead of running wait_serial manually. That's why I think it's a test api issue.
Below is how I used "script_output" in my test case:
my $timeout = 3600 * 9;
my $interval = 120;
my $cmd = "[[ -f /var/log/qaset/control/DONE ]] && echo 'done' || echo 'running'";
while ($timeout >= 0) {
my $output = script_output($cmd, 120);
$output =~ s/^\s+|\s+$//g;
if ($output eq "done") {
last;
}
else {
$timeout -= $interval;
sleep($interval);
}
}
hm, this looks ok. Yes, probably a testapi issue.
It seems to me that curl is too slow for some reason. In the log wait_serial reports fail before Mojo logs for download are displayed. Try to use 'type_string' instead of 'script_output' like (not tested):
my $timeout = 3600 * 9;
my $interval = 120;
my $cmd = "[[ -f /var/log/qaset/control/DONE ]] && echo 'done'\n";
while ($timeout >= 0) {
type_string($cmd);
last if wait_serial('done', $interval);
$timeout -= $interval;
}
Btw. $timeout 9hours is way too much for openQA. It will kill the job after 2h.
script_output has to work still. But I never seen such a problem.
I've replaced "script_output" with "type_string" and "wait_serial". So far so good. Thanks for your suggestion.
oholecek wrote:
It seems to me that curl is too slow for some reason. In the log wait_serial reports fail before Mojo logs for download are displayed. Try to use 'type_string' instead of 'script_output' like (not tested):
Btw. $timeout 9hours is way too much for openQA. It will kill the job after 2h.
- Status changed from New to Resolved
according to the latest comment this seems to be fine. Also I don't recall any symptoms like the ones described here unless for very specific cases, e.g. s390x. reopen if you think it's still happening.
- Related to action #25620: [sle][functional][tools][svirt-hyperv-uefi] test fails in install_and_reboot with no wait_serial output whatsoever added
- Related to deleted (action #25620: [sle][functional][tools][svirt-hyperv-uefi] test fails in install_and_reboot with no wait_serial output whatsoever)
Also available in: Atom
PDF