⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 277395 in webkit


Ignore:
Timestamp:
May 12, 2021, 3:07:49 PM (5 years ago)
Author:
aakash_jain@apple.com
Message:

[build.webkit.org] Bots should automatically recover from svn checkout is already locked issue
https://bugs.webkit.org/show_bug.cgi?id=225717

Reviewed by Jonathan Bedard.

  • CISupport/build-webkit-org/steps.py:

(CheckOutSource): Set haltOnFailure to False so that cleanup step can run. Also set the step name while we are at it.
(CheckOutSource.init): Also set logEnviron to False.
(CheckOutSource.getResultSummary): Run SVNCleanup step in case of failure.
(SVNCleanup):
(SVNCleanup.init):
(SVNCleanup.evaluateCommand):

  • CISupport/build-webkit-org/steps_unittest.py: Added unit-tests for the new step.
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/CISupport/build-webkit-org/steps.py

    r277043 r277395  
    2222
    2323from buildbot.process import buildstep, factory, logobserver, properties
    24 from buildbot.process.results import Results, SUCCESS, FAILURE, WARNINGS, SKIPPED, EXCEPTION
     24from buildbot.process.results import Results, SUCCESS, FAILURE, WARNINGS, SKIPPED, EXCEPTION, RETRY
    2525from buildbot.steps import master, shell, transfer, trigger
    2626from buildbot.steps.source.svn import SVN
     
    131131
    132132class CheckOutSource(SVN, object):
     133    name = 'clean-and-update-working-directory'
     134    haltOnFailure = False
     135
    133136    def __init__(self, **kwargs):
    134137        kwargs['repourl'] = 'https://svn.webkit.org/repository/webkit/trunk'
    135138        kwargs['mode'] = 'incremental'
     139        kwargs['logEnviron'] = False
    136140        super(CheckOutSource, self).__init__(**kwargs)
     141
     142    def getResultSummary(self):
     143        if self.results == FAILURE:
     144            self.build.addStepsAfterCurrentStep([SVNCleanup()])
     145
     146        if self.results != SUCCESS:
     147            return {'step': 'Failed to updated working directory'}
     148        else:
     149            return {'step': 'Cleaned and updated working directory'}
     150
     151
     152class SVNCleanup(shell.ShellCommand):
     153    name = 'svn-cleanup'
     154    command = ['svn', 'cleanup']
     155    descriptionDone = ['Run svn cleanup']
     156
     157    def __init__(self, **kwargs):
     158        super(SVNCleanup, self).__init__(timeout=10 * 60, logEnviron=False, **kwargs)
     159
     160    def evaluateCommand(self, cmd):
     161        self.build.buildFinished(['svn issue, retrying build'], RETRY)
     162        return super(SVNCleanup, self).evaluateCommand(cmd)
    137163
    138164
  • trunk/Tools/CISupport/build-webkit-org/steps_unittest.py

    r277043 r277395  
    992992        self.expectOutcome(result=FAILURE, state_string='failed (1) (failure)')
    993993        return self.runStep()
     994
     995
     996class TestSVNCleanup(BuildStepMixinAdditions, unittest.TestCase):
     997    def setUp(self):
     998        self.longMessage = True
     999        return self.setUpBuildStep()
     1000
     1001    def tearDown(self):
     1002        return self.tearDownBuildStep()
     1003
     1004    def test_success(self):
     1005        self.setupStep(SVNCleanup())
     1006        self.expectRemoteCommands(
     1007            ExpectShell(
     1008                workdir='wkdir',
     1009                timeout=600,
     1010                logEnviron=False,
     1011                command=['svn', 'cleanup'],
     1012            ) + 0,
     1013        )
     1014        self.expectOutcome(result=SUCCESS, state_string='Run svn cleanup')
     1015        return self.runStep()
     1016
     1017    def test_failure(self):
     1018        self.setupStep(SVNCleanup())
     1019        self.expectRemoteCommands(
     1020            ExpectShell(
     1021                workdir='wkdir',
     1022                timeout=600,
     1023                logEnviron=False,
     1024                command=['svn', 'cleanup'],
     1025            ) + 2
     1026            + ExpectShell.log('stdio', stdout='Unexpected error.'),
     1027        )
     1028        self.expectOutcome(result=FAILURE, state_string='Run svn cleanup (failure)')
     1029        return self.runStep()
  • trunk/Tools/ChangeLog

    r277393 r277395  
     12021-05-12  Aakash Jain  <aakash_jain@apple.com>
     2
     3        [build.webkit.org] Bots should automatically recover from svn checkout is already locked issue
     4        https://bugs.webkit.org/show_bug.cgi?id=225717
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        * CISupport/build-webkit-org/steps.py:
     9        (CheckOutSource): Set haltOnFailure to False so that cleanup step can run. Also set the step name while we are at it.
     10        (CheckOutSource.__init__): Also set logEnviron to False.
     11        (CheckOutSource.getResultSummary): Run SVNCleanup step in case of failure.
     12        (SVNCleanup):
     13        (SVNCleanup.__init__):
     14        (SVNCleanup.evaluateCommand):
     15        * CISupport/build-webkit-org/steps_unittest.py: Added unit-tests for the new step.
     16
    1172021-05-12  Chris Dumez  <cdumez@apple.com>
    218
Note: See TracChangeset for help on using the changeset viewer.