Bug 13390 - oe-selftest qemu process handling issue
Summary: oe-selftest qemu process handling issue
Status: RESOLVED FIXED
Alias: None
Product: Functional (self) Testing
Classification: QA/Testing
Component: oe-selftest (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.8 M2
Assignee: Chen Qi
QA Contact:
URL:
Whiteboard:
: 13399 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-06-11 12:50 UTC by Richard Purdie
Modified: 2019-07-22 01:48 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Purdie 2019-06-11 12:50:53 UTC
From https://autobuilder.yoctoproject.org/typhoon/#/builders/59/builds/688

2019-06-10 23:03:09,869 - oe-selftest - INFO - 2: 6/12 10/16 (6.07s) (runqemu.RunqemuTests.test_boot_machine_slirp)
2019-06-10 23:03:09,869 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/home/pokybuild/yocto-worker/qemux86/build/meta/lib/oeqa/selftest/cases/runqemu.py", line 107, in test_boot_machine_slirp
    with runqemu(self.recipe, ssh=False, launch_cmd=cmd) as qemu:
  File "/usr/lib64/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/home/pokybuild/yocto-worker/qemux86/build/meta/lib/oeqa/utils/commands.py", line 339, in runqemu
    qemu.start(params=qemuparams, ssh=ssh, runqemuparams=runqemuparams, launch_cmd=launch_cmd, discard_writes=discard_writes)
  File "/home/pokybuild/yocto-worker/qemux86/build/meta/lib/oeqa/targetcontrol.py", line 164, in start
    start = self.runner.launch(get_ip=ssh, launch_cmd=launch_cmd, qemuparams=params)
  File "/home/pokybuild/yocto-worker/qemux86/build/meta/lib/oeqa/utils/qemurunner.py", line 207, in launch
    while not self.is_alive() and time.time() < endtime:
  File "/home/pokybuild/yocto-worker/qemux86/build/meta/lib/oeqa/utils/qemurunner.py", line 431, in is_alive
    qemupid = int(qemu_pid)
ValueError: invalid literal for int() with base 10: ''


2019-06-10 23:03:21,583 - oe-selftest - INFO - runqemu.RunqemuTests.test_boot_machine_slirp_qcow2 (subunit.RemotedTestCase)
Comment 1 Richard Purdie 2019-06-14 12:16:16 UTC
*** Bug 13399 has been marked as a duplicate of this bug. ***
Comment 2 Chen Qi 2019-07-22 01:48:55 UTC
commit 7a6b2ce603a44db60a3ba7a4a62ec3c04c1db656
Author: Chen Qi <Qi.Chen@windriver.com>
Date:   Fri Jul 12 15:31:13 2019 +0800

    qemurunner.py: fix race condition at qemu startup
    
    When handling pid file, qemu would first create the file, stat it,
    lock it and then write actually contents to it.
    
    So it's possbile that when reading the pid file, the content is empty.
    
    [YOCTO #13390]
    
    (From OE-Core rev: 170e59b203a02f8438b9aeab3a45f6fcd6608b1f)
    
    Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>