Bug 2123

Summary: Add in tests for re-execution of tasks
Product: [QA/Testing] Test Plans/Suite Reporter: Richard Purdie <richard.purdie>
Component: test-plans/suiteAssignee: Jiajun Xu <jiajun.xu>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: Low CC: jessica.zhang, laurentiu.serban, sanil.kumar, song.liu, venkatarg, yp.test.watcher, yp.watcher
Version: unspecified   
Target Milestone: 1.3 M1   
Hardware: x86   
OS: Multiple   
Whiteboard: (P2)(No QA needed)(patch checked in)
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---
Attachments:
Description Flags
13 failed tasks with force against qemux86 core-image-sato-sdk
none
script to force run all tasks
none
Test case for re-execution
none
Test for re-execution of tasks
none
Test for re-execution of tasks (correct version this time)
none
Test for re-execution of tasks (v4)
none
test-reexec none

Description Richard Purdie 2012-03-15 13:37:45 UTC
Currently we are seeing problems when tasks are rerun due to changes in sstate hashes. For example, bitbake boost;bitbake boost -c compile -f fails.

We should write a script that:

a) builds world
b) Iterates over each task that was executed and rexecutes it with -f, then builds world again.
c) Logs failures
d) If a failure occurs, cleans the recipe and rebuilds so that testing can continue.

We would then need to fix issues identified
Comment 1 Jiajun Xu 2012-03-25 14:55:07 UTC
I tried master with commit (82b6146ef29f06b....), there are 13 tasks failed due to different reasons against qemux86 core-image-sato-sdk.
Attach the failure log and re-run log for reference.
Comment 2 Jiajun Xu 2012-03-25 14:59:31 UTC
Created attachment 401 [details]
13 failed tasks with force against qemux86 core-image-sato-sdk
Comment 3 Richard Purdie 2012-03-26 10:49:53 UTC
Jiajun, do you have the script you used to generate these results?
Comment 4 Jiajun Xu 2012-03-27 02:48:16 UTC
Created attachment 402 [details]
script to force run all tasks
Comment 5 Jiajun Xu 2012-03-27 02:50:19 UTC
(In reply to comment #3)
> Jiajun, do you have the script you used to generate these results?

Yes. I upload the script here. Could you help to check if it's OK?
I would like to add it into 1.2 M4 testing, and mark the bug as fixed if the script could run well.
Comment 6 Richard Purdie 2012-03-29 12:15:50 UTC
Created attachment 412 [details]
Test case for re-execution

This is my attempt at writing a script to find these bugs. It turns out to be quite tricky to cover all cases since we need to check the actual task in question reruns correctly and all subsequent tasks too. We also need to ensure sstate doesn't interfere.
Comment 7 Richard Purdie 2012-03-29 12:18:32 UTC
(In reply to comment #5)
> (In reply to comment #3)
> > Jiajun, do you have the script you used to generate these results?
> 
> Yes. I upload the script here. Could you help to check if it's OK?
> I would like to add it into 1.2 M4 testing, and mark the bug as fixed if the
> script could run well.

I've uploaded a bit of a different version of this idea since I found it hard to catch all the different problem re-execution cases.

With my version you'd do a "bitbake world" or "bitbake core-image-minimal" or whatever you'd want to test re-exection of, then run the script. It will iterate over all built stamps, re-executing tasks.

I've not done much testing with it yet but it will catch the nasm-native issue we have an open bug for.
Comment 8 Richard Purdie 2012-03-29 12:19:05 UTC
Created attachment 413 [details]
Test for re-execution of tasks
Comment 9 Richard Purdie 2012-03-29 12:20:43 UTC
Created attachment 414 [details]
Test for re-execution of tasks (correct version this time)
Comment 10 Richard Purdie 2012-03-30 13:07:59 UTC
Created attachment 420 [details]
Test for re-execution of tasks (v4)

Attached is another updated version of this with more issues fixed. It seems to be working well now.
Comment 11 Richard Purdie 2012-04-06 14:43:50 UTC
In order to close this bug, we need to check a script into master which has the desired functionality. At the moment, I don't like my script due to the need to patch base.bbclass and add the cleansstate2 task. So the work there isn't complete yet but I'm not sure at this point how we address that. Actually closing 2123 is not necessarily a 1.2 feature though. For 1.2 we just need to fix the bugs the script shows.
Comment 12 venkata ramana g 2012-04-09 07:12:54 UTC
Why cannot we execute cleanstate with -f option instead of adding cleanstate2 ?
Comment 13 Jiajun Xu 2012-05-16 15:58:18 UTC
Created attachment 514 [details]
test-reexec
Comment 14 Jiajun Xu 2012-05-16 16:02:13 UTC
(In reply to comment #13)
> Created attachment 514 [details]
> test-reexec

Hi Richard,
I removed cleansstate2 and add a similar function in test-reexec. Could you help to review it?
Comment 15 Jiajun Xu 2012-05-21 03:19:39 UTC
Patch checked in as commit 3e57b1d7494ac649c08692182aa522113926ccce.

commit 3e57b1d7494ac649c08692182aa522113926ccce
Author: Jiajun Xu <jiajun.xu@intel.com>
Date:   Fri May 18 17:18:14 2012 +0300

    test-reexec: Add script to address issues when task re-execution

    The script is used to address build issues when tasks of different
    recipes are re-executed. The script goes through all available recipes
    and their tasks. The test results are saved in ./reexeclogs. Force build
    logs are saved with prefix "force". Build failure logs are saved with
    prefix "failed".

    [YOCTO #2123]

    (From OE-Core rev: 6258a11f22103d68d02e329c2e7fb198202cc6ef)

    Signed-off-by: Jiajun Xu <jiajun.xu@intel.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Comment 16 Laurentiu Serban 2012-06-29 13:49:52 UTC
Verified