[Notes] [Git][BuildStream/buildstream][Qinusty/retries-should-fail] 4 commits: job.py: Modify retry messages to be FAIL



Title: GitLab

Qinusty pushed to branch Qinusty/retries-should-fail at BuildStream / buildstream

Commits:

5 changed files:

Changes:

  • buildstream/_message.py
    ... ... @@ -76,5 +76,8 @@ class Message():
    76 76
             self.task_id = task_id            # The plugin object ID of the task
    
    77 77
             self.scheduler = scheduler        # Whether this is a scheduler level message
    
    78 78
             self.creation_time = datetime.datetime.now()
    
    79
    -        if message_type in (MessageType.SUCCESS, MessageType.FAIL):
    
    79
    +        if message_type in (MessageType.SUCCESS, MessageType.FAIL, MessageType.SKIPPED):
    
    80 80
                 assert elapsed is not None
    
    81
    +        # logfile should always be associated with these messages
    
    82
    +        if message_type in (MessageType.START, MessageType.SUCCESS, MessageType.FAIL, MessageType.SKIPPED):
    
    83
    +            assert self.logfile, "START, SUCCESS, FAIL messages require logfile to be provided."

  • buildstream/_scheduler/jobs/job.py
    ... ... @@ -430,7 +430,8 @@ class Job():
    430 430
                     self.message(MessageType.BUG, self.action_name,
    
    431 431
                                  elapsed=elapsed, detail=detail,
    
    432 432
                                  logfile=filename)
    
    433
    -                self._child_shutdown(RC_FAIL)
    
    433
    +                # Unhandled exceptions should permenantly fail
    
    434
    +                self._child_shutdown(RC_PERM_FAIL)
    
    434 435
     
    
    435 436
                 else:
    
    436 437
                     # No exception occurred in the action
    
    ... ... @@ -509,11 +510,6 @@ class Job():
    509 510
             message.action_name = self.action_name
    
    510 511
             message.task_id = self._task_id
    
    511 512
     
    
    512
    -        if (message.message_type == MessageType.FAIL and
    
    513
    -                self._tries <= self._max_retries and self._retry_flag):
    
    514
    -            # Job will be retried, display failures as warnings in the frontend
    
    515
    -            message.message_type = MessageType.WARN
    
    516
    -
    
    517 513
             # Send to frontend if appropriate
    
    518 514
             if context.silent_messages() and (message.message_type not in unconditional_messages):
    
    519 515
                 return
    

  • tests/sources/deb.py
    ... ... @@ -56,7 +56,7 @@ def test_fetch_bad_url(cli, tmpdir, datafiles):
    56 56
         result = cli.run(project=project, args=[
    
    57 57
             'fetch', 'target.bst'
    
    58 58
         ])
    
    59
    -    assert "Try #" in result.stderr
    
    59
    +    assert "FAILURE Try #" in result.stderr
    
    60 60
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    61 61
         result.assert_task_error(ErrorDomain.SOURCE, None)
    
    62 62
     
    

  • tests/sources/tar.py
    ... ... @@ -67,7 +67,7 @@ def test_fetch_bad_url(cli, tmpdir, datafiles):
    67 67
         result = cli.run(project=project, args=[
    
    68 68
             'fetch', 'target.bst'
    
    69 69
         ])
    
    70
    -    assert "Try #" in result.stderr
    
    70
    +    assert "FAILURE Try #" in result.stderr
    
    71 71
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    72 72
         result.assert_task_error(ErrorDomain.SOURCE, None)
    
    73 73
     
    

  • tests/sources/zip.py
    ... ... @@ -53,7 +53,7 @@ def test_fetch_bad_url(cli, tmpdir, datafiles):
    53 53
         result = cli.run(project=project, args=[
    
    54 54
             'fetch', 'target.bst'
    
    55 55
         ])
    
    56
    -    assert "Try #" in result.stderr
    
    56
    +    assert "FAILURE Try #" in result.stderr
    
    57 57
         result.assert_main_error(ErrorDomain.STREAM, None)
    
    58 58
         result.assert_task_error(ErrorDomain.SOURCE, None)
    
    59 59
     
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]