Changeset 247364 in webkit


Ignore:
Timestamp:
Jul 11, 2019 2:12:39 PM (5 years ago)
Author:
aakash_jain@apple.com
Message:

[ews-build] Add build step to clean up .git/index.lock file
https://bugs.webkit.org/show_bug.cgi?id=199722

Reviewed by Jonathan Bedard.

  • BuildSlaveSupport/ews-build/steps.py:

(CheckOutSource.getResultSummary): Run CleanUpGitIndexLock step when CheckOutSource fails.
(CleanUpGitIndexLock.init): Configure timeout and logEnviron.
(CleanUpGitIndexLock.evaluateCommand): Always RETRY the build after this step is run.

  • BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
Location:
trunk/Tools
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/BuildSlaveSupport/ews-build/steps.py

    r247305 r247364  
    103103
    104104    def getResultSummary(self):
     105        if self.results == FAILURE:
     106            self.build.addStepsAfterCurrentStep([CleanUpGitIndexLock()])
     107
    105108        if self.results != SUCCESS:
    106109            return {u'step': u'Failed to updated working directory'}
    107110        else:
    108111            return {u'step': u'Cleaned and updated working directory'}
     112
     113
     114class CleanUpGitIndexLock(shell.ShellCommand):
     115    name = 'clean-git-index-lock'
     116    command = ['rm', '-f', '.git/index.lock']
     117    descriptionDone = ['Deleted .git/index.lock']
     118
     119    def __init__(self, **kwargs):
     120        super(CleanUpGitIndexLock, self).__init__(timeout=2 * 60, logEnviron=False, **kwargs)
     121
     122    def evaluateCommand(self, cmd):
     123        self.build.buildFinished(['Git issue, retrying build'], RETRY)
     124        return super(CleanUpGitIndexLock, self).evaluateCommand(cmd)
    109125
    110126
  • trunk/Tools/BuildSlaveSupport/ews-build/steps_unittest.py

    r247305 r247364  
    3636
    3737from steps import (AnalyzeAPITestsResults, AnalyzeCompileWebKitResults, ApplyPatch, ArchiveBuiltProduct, ArchiveTestResults,
    38                    CheckOutSource, CheckOutSpecificRevision, CheckPatchRelevance, CheckStyle, CleanBuild, CleanWorkingDirectory,
     38                   CheckOutSource, CheckOutSpecificRevision, CheckPatchRelevance, CheckStyle, CleanBuild, CleanUpGitIndexLock, CleanWorkingDirectory,
    3939                   CompileJSCOnly, CompileJSCOnlyToT, CompileWebKit, CompileWebKitToT, ConfigureBuild,
    4040                   DownloadBuiltProduct, ExtractBuiltProduct, ExtractTestResults, InstallGtkDependencies, InstallWpeDependencies, KillOldProcesses,
     
    476476        )
    477477        self.expectOutcome(result=FAILURE, state_string='Deleted WebKitBuild directory (failure)')
     478        return self.runStep()
     479
     480
     481class TestCleanUpGitIndexLock(BuildStepMixinAdditions, unittest.TestCase):
     482    def setUp(self):
     483        self.longMessage = True
     484        return self.setUpBuildStep()
     485
     486    def tearDown(self):
     487        return self.tearDownBuildStep()
     488
     489    def test_success(self):
     490        self.setupStep(CleanUpGitIndexLock())
     491        self.expectRemoteCommands(
     492            ExpectShell(workdir='wkdir',
     493                        timeout=120,
     494                        logEnviron=False,
     495                        command=['rm', '-f', '.git/index.lock'],
     496                        )
     497            + 0,
     498        )
     499        self.expectOutcome(result=SUCCESS, state_string='Deleted .git/index.lock')
     500        return self.runStep()
     501
     502    def test_failure(self):
     503        self.setupStep(CleanUpGitIndexLock())
     504        self.expectRemoteCommands(
     505            ExpectShell(workdir='wkdir',
     506                        timeout=120,
     507                        logEnviron=False,
     508                        command=['rm', '-f', '.git/index.lock'],
     509                        )
     510            + ExpectShell.log('stdio', stdout='Unexpected error.')
     511            + 1,
     512        )
     513        self.expectOutcome(result=FAILURE, state_string='Deleted .git/index.lock (failure)')
    478514        return self.runStep()
    479515
  • trunk/Tools/ChangeLog

    r247355 r247364  
     12019-07-11  Aakash Jain  <aakash_jain@apple.com>
     2
     3        [ews-build] Add build step to clean up .git/index.lock file
     4        https://bugs.webkit.org/show_bug.cgi?id=199722
     5
     6        Reviewed by Jonathan Bedard.
     7
     8        * BuildSlaveSupport/ews-build/steps.py:
     9        (CheckOutSource.getResultSummary): Run CleanUpGitIndexLock step when CheckOutSource fails.
     10        (CleanUpGitIndexLock.__init__): Configure timeout and logEnviron.
     11        (CleanUpGitIndexLock.evaluateCommand): Always RETRY the build after this step is run.
     12        * BuildSlaveSupport/ews-build/steps_unittest.py: Added unit-tests.
     13
    1142019-07-11  Jonathan Bedard  <jbedard@apple.com>
    215
Note: See TracChangeset for help on using the changeset viewer.