Project

General

Profile

Actions

action #58253

closed

[qe-core][qem][openqa] qaset: request to add monitoring commands

Added by kgw_suse over 4 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Enhancement to existing tests
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:

Description

Problem

The qaset utility (package qa_testset_automation) allows for suspending and resuming execution, but there appears to be no official interface for monitoring what happens.

Context

poo#46463, openQA pull request 8539

Details

The PR8539 openQA code, file

/var/lib/openqa/share/tests/sle/tests/qa_automation/kernel_multipath.pm

actually needs the possibility of suspending and resuming qaset-driven tests.
It comments on the challenge presented by the desire to properly monitor this as follows:

# FIXME: The status queries for qaset (pkg qa_testset_automation) in
# the subsequent two subs are rather awkward "inofficial" workarounds:
# the current qaset API does not seem to offer such queries.
#
# A request to implement API commands like, e.g.,
#
#     /usr/share/qa/qaset/qaset status          # clean/running/stopped/done
#     /usr/share/qa/qaset/qaset waitstop        # wait until status is "stopped"
#     /usr/share/qa/qaset/qaset waitdone        # wait until status is "done"
#
# is under way.
#
sub qaset_waitdone {
# qaset has been observed to create file /var/log/qaset/control/DONE
# as soon as
# -  no testsuite run is in progress anymore _and_
# -  there is no testsuite waiting for execution anymore
#    (file /var/log/qaset/control/NEXT_RUN)
#
my ($timeout) = @_;
assert_script_run(
"until [ -f /var/log/qaset/control/DONE ]; do sleep 5; done",
timeout      => $timeout,
fail_message => "qaset failed to announce overall completion within $timeout s");
}
# Invocation: qaset_waitstop(testname => $testname, timeout => $timeout [,prewait => $prewait]);
#
sub qaset_waitstop {
#
# FIXME: This sub is particularly awkward due to the need for $prewait.
# Observed: the following qaset behavior:
#
# qaset creates file /var/log/qaset/control/SYSTEM_DIRTY as soon
# as no testsuite run is in progress anymore (In contrast to
# DONE further testsuites-to-execute may be left waiting, like
# after a qaset stop).
#
# If some testsuite is left waiting for execution (file NEXT_RUN),
# starting another qaset run will delete an existing file SYSTEM_DIRTY:
# WARNING: but it has been observed to do so only after a delay of a few
# (FIXME: how many?) seconds. It is thus unsafe to start polling for
# SYSTEM_DIRTY immediately after such a restart. Hence $prewait.
#
my %args     = @_;
my $testname = $args{testname};
my $timeout  = $args{timeout};
my $prewait  = $args{prewait} // 15;    # 15 is guessed to be enough :-/
sleep $prewait if $prewait > 0;
assert_script_run(
"until [ -f /var/log/qaset/control/SYSTEM_DIRTY ]; do sleep 5; done",
timeout      => $timeout,
fail_message => "$testname: qaset run failed to complete in $timeout s");
}

The main point of this request is to obtain a reliable official way to carry out such monitoring

Hope is that for somebody familiar with qaset's process management the implementation of additional subcommands like the ones in the comment might be fairly straightforward.

Actions #1

Updated by okurz over 4 years ago

  • Category set to Enhancement to existing tests
Actions #2

Updated by tjyrinki_suse almost 4 years ago

  • Status changed from New to Workable
Actions #3

Updated by tjyrinki_suse over 3 years ago

  • Subject changed from [qam][openqa] qaset: request to add monitoring commands to [qe-core][qam][openqa] qaset: request to add monitoring commands
Actions #4

Updated by tjyrinki_suse over 3 years ago

  • Subject changed from [qe-core][qam][openqa] qaset: request to add monitoring commands to [qe-core][qem][openqa] qaset: request to add monitoring commands
  • Start date deleted (2019-10-16)
Actions #5

Updated by tjyrinki_suse almost 3 years ago

  • Status changed from Workable to New
  • Assignee set to tonyyuan
Actions #6

Updated by tjyrinki_suse almost 3 years ago

Tony will check the request and analyze the need for it these days.

Actions #7

Updated by tonyyuan almost 3 years ago

qaset was designed to execute multiple testsuites together, like qa_test_multipath, qa_test_bash, qa_test_gzip .... The testsuite is the minimum test unit. The so called execution suspending and resuming are very basic:
stop/suspending : it finishs the current testsuite execution and keep the unexecuted testsuites list into file(/var/log/qaset/control/NEXT_RUN) and exit totally.
resume: It just sends a message "You need manually run the list again!!!". If you want to really resuming you have to rerun "/usr/share/qa/qaset/qaset run" command. This time qaset will start executing the first testsuite in NEXT_RUN file.

So with the current qaset logic, it's impossible to impliment the requested sub commands.

Actions #8

Updated by tonyyuan almost 3 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF