Bug 12885

Summary: [2.5.1 rc1] selftest wic test cases produce random results on debian9
Product: [QA/Testing] Runtime Testing Reporter: Mohamad Noor Alim <mohamad.noor.alim.hussin>
Component: generalAssignee: Anuj Mittal <anuj.mittal>
Status: RESOLVED FIXED QA Contact: Mohamad Noor Alim <mohamad.noor.alim.hussin>
Severity: normal    
Priority: Medium+ CC: akuster, randy.macleod, richard.purdie
Version: 2.5.1   
Target Milestone: 2.5.2   
Hardware: x86   
OS: x86_64   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Mohamad Noor Alim 2018-08-14 05:51:48 UTC
There are some test cases for oe-selftest failed on Debian9. The test cases are as follows:
- wic.wic.test_bmap_short
- wic.wic.test_compress_xz 
- wic.wic.test_exclude_path

These test cases passed if run manually. Every time we rerun the oe-selftest, some of the wic test case would failed and some passed.
These are examples of error messages

2018-08-08 08:28:28,146 - oe-selftest - INFO - ======================================================================
2018-08-08 08:28:28,146 - oe-selftest - INFO - FAIL [34.487s]: test_bmap_short (wic.Wic)
2018-08-08 08:28:28,146 - oe-selftest - INFO - ----------------------------------------------------------------------
2018-08-08 08:28:28,147 - oe-selftest - INFO - Traceback (most recent call last):
  File "/home/ab/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f
    return func(*args, **kwargs)
  File "/home/ab/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py", line 529, in test_bmap_short
    status = runCmd(cmd).status
  File "/home/ab/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/utils/commands.py", line 191, in runCmd
    raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, exc_output))
AssertionError: Command 'wic create wictestdisk -e core-image-minimal -m -o /var/tmp/wic.oe-selftest/' returned non-zero exit status 1:
INFO: Building wic-tools...

2018-08-08 08:28:28,147 - oe-selftest - INFO - FAIL [33.813s]: test_compress_xz (wic.Wic)
2018-08-08 08:28:28,147 - oe-selftest - INFO - ----------------------------------------------------------------------
2018-08-08 08:28:28,147 - oe-selftest - INFO - Traceback (most recent call last):
  File "/home/ab/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f
    return func(*args, **kwargs)
  File "/home/ab/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py", line 304, in test_compress_xz
    "--compress-with=xz -o %s" % self.resultdir).status)
  File "/home/ab/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/utils/commands.py", line 191, in runCmd
    raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, exc_output))
AssertionError: Command 'wic create wictestdisk --image-name=core-image-minimal --compress-with=xz -o /var/tmp/wic.oe-selftest/' returned non-zero exit status 1:
INFO: Building wic-tools...

2018-08-13 13:42:17,392 - oe-selftest - INFO - ======================================================================
2018-08-13 13:42:17,392 - oe-selftest - INFO - FAIL [40.374s]: test_exclude_path (wic.Wic)
2018-08-13 13:42:17,393 - oe-selftest - INFO - ----------------------------------------------------------------------
2018-08-13 13:42:17,393 - oe-selftest - INFO - Traceback (most recent call last):
  File "/home/ab/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/core/decorator/__init__.py", line 32, in wrapped_f
    return func(*args, **kwargs)
  File "/home/ab/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/cases/wic.py", line 415, in test_exclude_path
    % (wks_file, self.resultdir)).status)
  File "/home/ab/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/utils/commands.py", line 191, in runCmd
    raise AssertionError("Command '%s' returned non-zero exit status %d:\n%s" % (command, result.status, exc_output))
AssertionError: Command 'wic create temp.wks -e core-image-minimal -o /var/tmp/wic.oe-selftest/' returned non-zero exit status 1:
INFO: Building wic-tools...
ERROR: Unable to start bitbake server
Comment 1 Richard Purdie 2018-08-16 14:41:46 UTC
Might be worth looking at whether the native sysroot pieces of http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=d9087c7c477b101fea4d35547da2d0843940cfd9 are any issue?
http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=5e8367e17f8ab1023b4a536348282fcea4df927d would be an issue if two selftest were running on the same machine?
Comment 2 Armin Kuster 2018-11-05 23:48:38 UTC
has anyone tried the patches pointed out? I am more than happy to back port them.
Comment 3 Anuj Mittal 2018-11-07 01:00:23 UTC
I did check this and wasn't able to reproduce on my machine. I will see if I can test it on debian9.
Comment 4 Anuj Mittal 2018-11-12 08:18:43 UTC
(In reply to comment #1)
> http://git.yoctoproject.org/cgit.cgi/poky/commit/
> ?id=5e8367e17f8ab1023b4a536348282fcea4df927d would be an issue if two
> selftest were running on the same machine?

I was able to test this on the debian9 builder on which this was failing. And I had to include these wic fixes by Richard to get this to build:

https://git.yoctoproject.org/cgit.cgi/poky/commit?id=5e8367e17f8ab1023b4a536348282fcea4df927d

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit?id=eacc12c2ec6d778c70f91f8c754f64c6c097f35a

https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=e3dcd61337fb5f89a3f875ec9dd7551529722feb

Armin, can you please include these for sumo?
Comment 5 Armin Kuster 2018-11-12 15:42:48 UTC
(In reply to comment #4)
> (In reply to comment #1)
> > http://git.yoctoproject.org/cgit.cgi/poky/commit/
> > ?id=5e8367e17f8ab1023b4a536348282fcea4df927d would be an issue if two
> > selftest were running on the same machine?
> 
> I was able to test this on the debian9 builder on which this was failing.
> And I had to include these wic fixes by Richard to get this to build:
> 
> https://git.yoctoproject.org/cgit.cgi/poky/
> commit?id=5e8367e17f8ab1023b4a536348282fcea4df927d
> 
> https://git.yoctoproject.org/cgit/cgit.cgi/poky/
> commit?id=eacc12c2ec6d778c70f91f8c754f64c6c097f35a
> 
> https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/
> ?id=e3dcd61337fb5f89a3f875ec9dd7551529722feb
> 
> Armin, can you please include these for sumo?

Got them in stable/sumo-nmu for testing
Comment 6 Anuj Mittal 2018-11-27 06:33:53 UTC
This was merged, marking as resolved. Alim, can you please let me know if see this again?
Comment 7 Armin Kuster 2018-11-27 15:02:11 UTC
(In reply to comment #6)
> This was merged, marking as resolved. Alim, can you please let me know if
> see this again?

Yes, this is in sumo proper

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=sumo&id=8799bc3171872f04429eee511693efb9842e80c0

to

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?h=sumo&id=0b96af3645fe2f7587499ee28df37628775c5ec2