action #93141
closedt/18-qemu-options.t fails on Leap 15.2 with coverage enabled
Description
It fails locally for Marius, Bill and me.
% PERL5OPT="-MDevel::Cover=-select_re,'^/lib',+ignore_re,lib/perlcritic/Perl/Critic/Policy,-coverage,statement,-db,cover_db_t" prove -l t/18-qemu-options.t
...
# [2021-05-26T16:09:08.354 CEST] [debug] QEMU: QEMU emulator version 4.2.1 (openSUSE Leap 15.2)
# [2021-05-26T16:09:08.354 CEST] [debug] QEMU: Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers
# [2021-05-26T16:09:08.355 CEST] [debug] sending magic and exit
# [2021-05-26T16:09:08.355 CEST] [debug] received magic close
# [2021-05-26T16:09:08.356 CEST] [debug] backend got TERM
# [2021-05-26T16:09:08.356 CEST] [debug] sending magic and exit
# syswrite() on closed filehandle GEN22 at /home/tina/openqa-devel/repos/os-autoinst/t/../myjsonrpc.pm line 55.
# [2021-05-26T16:09:08.360 CEST] [debug] backend process exited: 0
# failed to start VM at /home/tina/openqa-devel/repos/os-autoinst/t/../backend/driver.pm line 126.
# [2021-05-26T16:09:08.461 CEST] [debug] stopping command server 8229 because test execution ended through exception
# [2021-05-26T16:09:09.764 CEST] [debug] done with command server
# [2021-05-26T16:09:09.765 CEST] [debug] stopping autotest process 8232
# [2021-05-26T16:09:09.966 CEST] [debug] done with autotest process
# 8223: EXIT 1
# Deep recursion on subroutine "B::Deparse::_pessimise_walk_exe" at /usr/lib/perl5/5.26.1/B/Deparse.pm line 439.
# '
# doesn't match '(?^:-broken\: invalid option)'
# Looks like you failed 1 test of 16.
t/18-qemu-options.t .. 1/?
# Failed test 'qemu_append_option'
# at t/18-qemu-options.t line 110.
# Failed test 'expected failure as /no/dev/hugepages/ does not exist'
# at t/18-qemu-options.t line 119.
...
# [2021-05-26T16:09:21.713 CEST] [debug] QEMU: QEMU emulator version 4.2.1 (openSUSE Leap 15.2)
# [2021-05-26T16:09:21.713 CEST] [debug] QEMU: Copyright (c) 2003-2019 Fabrice Bellard and the QEMU Project developers
# [2021-05-26T16:09:21.714 CEST] [debug] sending magic and exit
# [2021-05-26T16:09:21.714 CEST] [debug] received magic close
# [2021-05-26T16:09:21.715 CEST] [debug] backend got TERM
# [2021-05-26T16:09:21.715 CEST] [debug] sending magic and exit
# syswrite() on closed filehandle GEN22 at /home/tina/openqa-devel/repos/os-autoinst/t/../myjsonrpc.pm line 55.
# [2021-05-26T16:09:21.720 CEST] [debug] backend process exited: 0
# failed to start VM at /home/tina/openqa-devel/repos/os-autoinst/t/../backend/driver.pm line 126.
# [2021-05-26T16:09:21.821 CEST] [debug] stopping command server 8305 because test execution ended through exception
# [2021-05-26T16:09:23.224 CEST] [debug] done with command server
# [2021-05-26T16:09:23.225 CEST] [debug] stopping autotest process 8308
# [2021-05-26T16:09:23.427 CEST] [debug] done with autotest process
# 8299: EXIT 1
# Deep recursion on subroutine "B::Deparse::_pessimise_walk_exe" at /usr/lib/perl5/5.26.1/B/Deparse.pm line 439.
# '
# doesn't match '(?^:can\'t open backing store /no/dev/hugepages/ for guest RAM\: No such file or directory)'
# Looks like you failed 1 test of 3.
t/18-qemu-options.t .. 2/?
# Failed test 'qemu_huge_pages_option'
# at t/18-qemu-options.t line 120.
t/18-qemu-options.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 2/3 subtests
Running it without coverage or setting local $ENV{PERL5OPT}="";
in the test makes it pass.
Acceptance criteria¶
- AC1: Test is passing with coverage enabled
Updated by tinita over 3 years ago
Hints for debugging¶
Prepare environment:¶
% cd /tmp/test
% cat vars.json
{
"ARCH" : "i386",
"BACKEND" : "qemu",
"CASEDIR" : "/home/YOURUSER/openqa-devel/repos/os-autoinst/t/data/tests",
"CDMODEL" : "ide-cd",
"HDDMODEL" : "ide-hd",
"HDDSIZEGB" : 10,
"INCLUDE_MODULES" : "none",
"ISO" : "/home/YOURUSER/openqa-devel/repos/os-autoinst/t/data/Core-7.2.iso",
"JOBTOKEN" : "cQIKgSewVq",
"NEEDLES_GIT_HASH" : "67c530841e7a1b5fc90881f02671130a2e92d6af",
"NICMAC" : "52:54:00:12:34:56",
"NICMODEL" : "virtio-net",
"NICTYPE" : "user",
"NICVLAN" : "0",
"NUMDISKS" : 1,
"PRODUCTDIR" : "/home/YOURUSER/openqa-devel/repos/os-autoinst/t/data/tests",
"QEMU" : "i386",
"QEMUCPUS" : 1,
"QEMUPORT" : 15222,
"QEMURAM" : 1024,
"QEMU_APPEND" : "broken option",
"QEMU_COMPRESS_QCOW2" : 1,
"QEMU_DISABLE_SNAPSHOTS" : "1",
"QEMU_NO_FDC_SET" : 1,
"QEMU_NO_KVM" : 1,
"QEMU_NO_TABLET" : 1,
"SCHEDULE" : "tests/noop",
"TEST_GIT_HASH" : "67c530841e7a1b5fc90881f02671130a2e92d6af",
"VERSION" : 1,
"VIRTIO_CONSOLE" : 1,
"VNC" : 90,
"WORKER_INSTANCE" : 3
}
Compare the following two commands:¶
QEMU_QMP_CONNECT_ATTEMPTS=1 PERL_MYJSONRPC_DEBUG=1 perl /home/YOURUSER/openqa-devel/repos/os-autoinst/isotovideo -d qemu_disable_snapshots=1
QEMU_QMP_CONNECT_ATTEMPTS=1 PERL_MYJSONRPC_DEBUG=1 PERL5OPT="-MDevel::Cover=-select_re,'^/lib',-coverage,statement,-db,cover_db_t" perl /home/YOURUSER/openqa-devel/repos/os-autoinst/isotovideo -d qemu_disable_snapshots=1
You will see that sending magic and exit
is printed twice in the second command (with coverage).
Additionally you will see backend got TERM
.
No idea how to debug where that signal comes from.
I still think we should measure coverage only in unit tests, and running the whole isotovideo script as a new process, which itself forks, should be done without coverage enabled.
Updated by okurz over 2 years ago
- Status changed from New to Feedback
- Assignee set to okurz
- Target version changed from future to Ready
Both the commands OPENQA_TEST_TIMEOUT_DISABLE=1 PERL5OPT="-MDevel::Cover=-select_re,'^/lib',+ignore_re,lib/perlcritic/Perl/Critic/Policy,-coverage,statement,-db,cover_db_t" prove -l t/18-qemu-options.t
and OPENQA_TEST_TIMEOUT_DISABLE=1 make coverage TESTS="t/18-qemu-options.t"
work for me so I can't reproduce the original problem.
I am not quite sure I understand your latest statement
I still think we should measure coverage only in unit tests, and running the whole isotovideo script as a new process, which itself forks, should be done without coverage enabled.
Can you elaborate?