Bug 5988

Summary: Wrong outcome (OUTCOME_NA) when task_executed = false
Product: [Build System, Metadata & Runtime] Toaster Reporter: Andreea Brandusa Proca <andreea.b.proca>
Component: toasterAssignee: Alexandru Damian <alexandru.damian>
Status: VERIFIED FIXED QA Contact: Ionut Chisanovici <ionutx.chisanovici>
Severity: normal    
Priority: Medium CC: alexandru.c.georgescu, alexandru.damian, belen.barros.pena, bogdanx.a.voiculescu, cristiana.voicu, ionutx.chisanovici, jessica.zhang
Version: unspecified   
Target Milestone: 1.6 M5   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
database
none
toaster db (belen)
none
Database
none
toaster_ui.log none

Description Andreea Brandusa Proca 2014-03-17 11:31:17 UTC
If task_executed = FALSE then outcome must be 1 (COVERED), 2 (CACHED), 3 (PREBUILT) or 5 (EMPTY)

But we have entries with outcome = NA (-1)

{
    "pk": 6572,.
    "model": "orm.task",.
    "fields": {
        "work_directory": "",.
        "cpu_usage": null,.
        "task_executed": false,.
        "task_name": "do_install",.
        "outcome": -1,.
    }
Comment 1 Andreea Brandusa Proca 2014-03-17 11:50:25 UTC
Created attachment 1827 [details]
database

master:463cd34f8c17c67c4f3adf3468424730b22f3974

I have attached the database.
Comment 2 Alexandru Damian 2014-03-17 12:29:01 UTC
This is not a bug.

It is normal to have -1 outcome if the "order" number is null. What happens here is that we have tasks that were referenced somewhere, but they didn't execute/evaluate in any way. This happens for interrupted builds or builds that stopped due to an error.

The UI does not display tasks without order information, so this data is not reaching the user in any way.

Please ammend the test to check for OUTCOME_NA (-1) only for tasks with order field not null.
Comment 3 Belen Barros Pena 2014-03-17 14:01:27 UTC
Created attachment 1828 [details]
toaster db (belen)

Check build 68: there are 3 tasks with order number and outcome = -1
Comment 4 Andreea Brandusa Proca 2014-03-19 13:22:25 UTC
Created attachment 1836 [details]
Database

I have created a build (core-image-minimal) finished successfully and we have the following situation:
{
    "pk": 2298,.
    "model": "orm.task",.
    "fields": {
        "work_directory": "",.
        "cpu_usage": null,.
        "task_executed": false,.
        "task_name": "do_populate_sysroot_setscene",.
        "message": "",.
        "outcome": -1,.
        "order": null,.
        "script_type": 0
    }
Comment 5 Andreea Brandusa Proca 2014-03-19 13:23:08 UTC
Created attachment 1837 [details]
toaster_ui.log
Comment 6 Belen Barros Pena 2014-03-19 14:40:34 UTC
This bug seems related to bug 5763, but I am not sure if they are duplicates.
Comment 7 Andreea Brandusa Proca 2014-03-20 11:33:15 UTC
I think that the scope of 5763 was adding OUTCOME_EMPTY in models.py.
Here we have a different situation: when the task is not executed, I have found tasks having: outcome = OUTCOME_NA (-1)
Comment 8 Alexandru Damian 2014-04-02 11:39:19 UTC
I cannot reproduce this with the latest master, 3e528d3e4bc542ca2f654c54363c56af0fb9f61b

I can only find tasks with outcome = -1 if the order number is Null, i.e. interrupted builds.
Comment 9 Ionut Chisanovici 2014-04-03 13:17:49 UTC
Hi Alex,

Same commit: 3e528d3e4bc542ca2f654c54363c56af0fb9f61b

Build no: 1

sqlite> select * from orm_task where id=29;
          build_id = 1
    work_directory = 
         cpu_usage = 
     task_executed = 0
           disk_io = 
       line_number = 0
path_to_sstate_obj = 
   sstate_checksum = 33c1ea5d554cb56823c90819aaef60ff
        source_url = 
             order = 661
      elapsed_time = 
           logfile = 
         recipe_id = 161
         task_name = do_build
           message = 
           outcome = 5
                id = 29
     sstate_result = 0
       script_type = 0

So, task_executed = 0 (False) and outcome = 5 (EMPTY)

Cheers,
Ionut C
Comment 10 Ionut Chisanovici 2014-04-03 13:29:10 UTC
This is verified.
When task_executed = 0 (False), outcome can take value 5 (EMPTY).

Cheers,
Ionut C
Comment 11 Ionut Chisanovici 2014-04-15 12:50:59 UTC
Verified.

IonutC