action #10534
closedwait_serial fails to match special string in serial console occasionally
0%
Description
A test died because wait_serial function failed to match anything in serial console using regex 'curl-0':
http://147.2.207.97/tests/694/file/autoinst-log.txt
But according to serial console log, the string "curl-0" did exist(the last line):
http://147.2.207.97/tests/694/file/serial0.txt
Updated by okurz about 9 years ago
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.
Updated by okurz about 9 years ago
Also take a look at https://github.com/os-autoinst/os-autoinst-distri-opensuse/pull/1006/files how tests can be improved
Updated by jtzhao about 9 years ago
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);
}
}
Updated by okurz about 9 years ago
hm, this looks ok. Yes, probably a testapi issue.
Updated by oholecek about 9 years ago
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.
Updated by coolo about 9 years ago
script_output has to work still. But I never seen such a problem.
Updated by jtzhao almost 9 years ago
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.
Updated by okurz over 8 years ago
- 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.
Updated by okurz over 7 years ago
- Related to action #23404: Serial output gets lost added
Updated by szarate over 7 years ago
- Related to action #25620: [sle][functional][tools][svirt-hyperv-uefi] test fails in install_and_reboot with no wait_serial output whatsoever added
Updated by szarate over 7 years ago
- Related to deleted (action #25620: [sle][functional][tools][svirt-hyperv-uefi] test fails in install_and_reboot with no wait_serial output whatsoever)