[Notes] [Git][BuildStream/buildstream][Qinusty/531-fetch-retries-on-terminate] 12 commits: Trying to mitigate a mtime granularity braking the cache tests



Title: GitLab

Qinusty pushed to branch Qinusty/531-fetch-retries-on-terminate at BuildStream / buildstream

Commits:

16 changed files:

Changes:

  • buildstream/_artifactcache/cascache.py
    ... ... @@ -25,6 +25,7 @@ import signal
    25 25
     import stat
    
    26 26
     import tempfile
    
    27 27
     import uuid
    
    28
    +import errno
    
    28 29
     from urllib.parse import urlparse
    
    29 30
     
    
    30 31
     import grpc
    
    ... ... @@ -82,7 +83,8 @@ class CASCache(ArtifactCache):
    82 83
     
    
    83 84
             tree = self.resolve_ref(ref, update_mtime=True)
    
    84 85
     
    
    85
    -        dest = os.path.join(self.extractdir, element._get_project().name, element.normal_name, tree.hash)
    
    86
    +        dest = os.path.join(self.extractdir, element._get_project().name,
    
    87
    +                            element.normal_name, tree.hash)
    
    86 88
             if os.path.isdir(dest):
    
    87 89
                 # artifact has already been extracted
    
    88 90
                 return dest
    
    ... ... @@ -100,7 +102,7 @@ class CASCache(ArtifactCache):
    100 102
                     #
    
    101 103
                     # If rename fails with these errors, another process beat
    
    102 104
                     # us to it so just ignore.
    
    103
    -                if e.errno not in [os.errno.ENOTEMPTY, os.errno.EEXIST]:
    
    105
    +                if e.errno not in [errno.ENOTEMPTY, errno.EEXIST]:
    
    104 106
                         raise ArtifactError("Failed to extract artifact for ref '{}': {}"
    
    105 107
                                             .format(ref, e)) from e
    
    106 108
     
    

  • buildstream/_frontend/app.py
    ... ... @@ -269,6 +269,9 @@ class App():
    269 269
                     else:
    
    270 270
                         self._message(MessageType.FAIL, session_name, elapsed=elapsed)
    
    271 271
     
    
    272
    +                    # Notify session failure
    
    273
    +                    self._notify("{} failed".format(session_name), "{}".format(e))
    
    274
    +
    
    272 275
                     if self._started:
    
    273 276
                         self._print_summary()
    
    274 277
     
    
    ... ... @@ -286,6 +289,9 @@ class App():
    286 289
                     if self._started:
    
    287 290
                         self._print_summary()
    
    288 291
     
    
    292
    +                # Notify session success
    
    293
    +                self._notify("{} succeeded".format(session_name), "")
    
    294
    +
    
    289 295
         # init_project()
    
    290 296
         #
    
    291 297
         # Initialize a new BuildStream project, either with the explicitly passed options,
    
    ... ... @@ -419,6 +425,12 @@ class App():
    419 425
         #                      Local Functions                     #
    
    420 426
         ############################################################
    
    421 427
     
    
    428
    +    # Local function for calling the notify() virtual method
    
    429
    +    #
    
    430
    +    def _notify(self, title, text):
    
    431
    +        if self.interactive:
    
    432
    +            self.notify(title, text)
    
    433
    +
    
    422 434
         # Local message propagator
    
    423 435
         #
    
    424 436
         def _message(self, message_type, message, **kwargs):
    
    ... ... @@ -571,8 +583,8 @@ class App():
    571 583
                 while choice not in ['continue', 'quit', 'terminate', 'retry']:
    
    572 584
                     click.echo(summary, err=True)
    
    573 585
     
    
    574
    -                self.notify("BuildStream failure", "{} on element {}"
    
    575
    -                            .format(failure.action_name, element.name))
    
    586
    +                self._notify("BuildStream failure", "{} on element {}"
    
    587
    +                             .format(failure.action_name, element.name))
    
    576 588
     
    
    577 589
                     try:
    
    578 590
                         choice = click.prompt("Choice:", default='continue', err=True,
    

  • buildstream/_pipeline.py
    ... ... @@ -359,23 +359,14 @@ class Pipeline():
    359 359
     
    
    360 360
             if inconsistent:
    
    361 361
                 detail = "Exact versions are missing for the following elements:\n\n"
    
    362
    -
    
    363
    -            missingTrack = 0
    
    364 362
                 for element in inconsistent:
    
    365
    -                detail += "  " + element._get_full_name()
    
    363
    +                detail += "  Element: {} is inconsistent\n".format(element._get_full_name())
    
    366 364
                     for source in element.sources():
    
    367
    -                    if not source._get_consistency() and not source.get_ref():
    
    368
    -                        if hasattr(source, 'tracking') and source.tracking is None:
    
    369
    -                            detail += ": Source {} is missing ref and track. ".format(source._get_full_name()) + \
    
    370
    -                                      "Please specify a ref or branch/tag to track."
    
    371
    -                            missingTrack = 1
    
    372
    -
    
    373
    -                detail += "\n"
    
    365
    +                    if source._get_consistency() == Consistency.INCONSISTENT:
    
    366
    +                        detail += "    Source {} is missing ref\n".format(source)
    
    367
    +                detail += '\n'
    
    368
    +            detail += "Try tracking these elements first with `bst track`\n"
    
    374 369
     
    
    375
    -            if missingTrack:
    
    376
    -                detail += "\nThen track these elements with `bst track`\n"
    
    377
    -            else:
    
    378
    -                detail += "\nTry tracking these elements first with `bst track`\n"
    
    379 370
                 raise PipelineError("Inconsistent pipeline", detail=detail, reason="inconsistent-pipeline")
    
    380 371
     
    
    381 372
         #############################################################
    

  • buildstream/_scheduler/jobs/job.py
    ... ... @@ -250,7 +250,7 @@ class Job():
    250 250
         #
    
    251 251
         def resume(self, silent=False):
    
    252 252
             if self._suspended:
    
    253
    -            if not silent:
    
    253
    +            if not silent and not self._scheduler.terminated:
    
    254 254
                     self.message(MessageType.STATUS,
    
    255 255
                                  "{} resuming".format(self.action_name))
    
    256 256
     
    
    ... ... @@ -549,7 +549,7 @@ class Job():
    549 549
             #
    
    550 550
             self._retry_flag = returncode not in (RC_OK, RC_PERM_FAIL)
    
    551 551
     
    
    552
    -        if self._retry_flag and (self._tries <= self._max_retries):
    
    552
    +        if self._retry_flag and (self._tries <= self._max_retries) and not self._scheduler.terminated:
    
    553 553
                 self.spawn()
    
    554 554
                 return
    
    555 555
     
    

  • buildstream/plugins/sources/git.py
    ... ... @@ -309,6 +309,13 @@ class GitSource(Source):
    309 309
             self.original_url = self.node_get_member(node, str, 'url')
    
    310 310
             self.mirror = GitMirror(self, '', self.original_url, ref)
    
    311 311
             self.tracking = self.node_get_member(node, str, 'track', None)
    
    312
    +
    
    313
    +        # At this point we now know if the source has a ref and/or a track.
    
    314
    +        # If it is missing both then we will be unable to track or build.
    
    315
    +        if self.mirror.ref is None and self.tracking is None:
    
    316
    +            raise SourceError("{}: Git sources require a ref and/or track".format(self),
    
    317
    +                              reason="missing-track-and-ref")
    
    318
    +
    
    312 319
             self.checkout_submodules = self.node_get_member(node, bool, 'checkout-submodules', True)
    
    313 320
             self.submodules = []
    
    314 321
     
    

  • buildstream/plugins/sources/ostree.py
    ... ... @@ -73,6 +73,12 @@ class OSTreeSource(Source):
    73 73
             self.mirror = os.path.join(self.get_mirror_directory(),
    
    74 74
                                        utils.url_directory_name(self.original_url))
    
    75 75
     
    
    76
    +        # At this point we now know if the source has a ref and/or a track.
    
    77
    +        # If it is missing both then we will be unable to track or build.
    
    78
    +        if self.ref is None and self.tracking is None:
    
    79
    +            raise SourceError("{}: OSTree sources require a ref and/or track".format(self),
    
    80
    +                              reason="missing-track-and-ref")
    
    81
    +
    
    76 82
             # (optional) Not all repos are signed. But if they are, get the gpg key
    
    77 83
             self.gpg_key_path = None
    
    78 84
             if self.node_get_member(node, str, 'gpg-key', None):
    

  • doc/examples/autotools/project.conf
    ... ... @@ -10,4 +10,4 @@ element-path: elements
    10 10
     # Define some aliases for the tarballs we download
    
    11 11
     aliases:
    
    12 12
       alpine: https://gnome7.codethink.co.uk/tarballs/
    
    13
    -  gnu: https://ftpmirror.gnu.org/gnu/automake/
    13
    +  gnu: http://ftpmirror.gnu.org/gnu/automake/

  • tests/artifactcache/expiry.py
    1
    +#
    
    2
    +#  Copyright (C) 2018 Codethink Limited
    
    3
    +#
    
    4
    +#  This program is free software; you can redistribute it and/or
    
    5
    +#  modify it under the terms of the GNU Lesser General Public
    
    6
    +#  License as published by the Free Software Foundation; either
    
    7
    +#  version 2 of the License, or (at your option) any later version.
    
    8
    +#
    
    9
    +#  This library is distributed in the hope that it will be useful,
    
    10
    +#  but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    11
    +#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    
    12
    +#  Lesser General Public License for more details.
    
    13
    +#
    
    14
    +#  You should have received a copy of the GNU Lesser General Public
    
    15
    +#  License along with this library. If not, see <http://www.gnu.org/licenses/>.
    
    16
    +#
    
    17
    +#  Authors: Tristan Maat <tristan maat codethink co uk>
    
    18
    +#
    
    19
    +
    
    1 20
     import os
    
    2 21
     
    
    3 22
     import pytest
    
    ... ... @@ -5,7 +24,7 @@ import pytest
    5 24
     from buildstream import _yaml
    
    6 25
     from buildstream._exceptions import ErrorDomain, LoadErrorReason
    
    7 26
     
    
    8
    -from tests.testutils import cli, create_element_size
    
    27
    +from tests.testutils import cli, create_element_size, wait_for_cache_granularity
    
    9 28
     
    
    10 29
     
    
    11 30
     DATA_DIR = os.path.join(
    
    ... ... @@ -108,6 +127,8 @@ def test_expiry_order(cli, datafiles, tmpdir):
    108 127
         res = cli.run(project=project, args=['build', 'target2.bst'])
    
    109 128
         res.assert_success()
    
    110 129
     
    
    130
    +    wait_for_cache_granularity()
    
    131
    +
    
    111 132
         # Now extract dep.bst
    
    112 133
         res = cli.run(project=project, args=['checkout', 'dep.bst', checkout])
    
    113 134
         res.assert_success()
    

  • tests/frontend/push.py
    1
    +#
    
    2
    +#  Copyright (C) 2018 Codethink Limited
    
    3
    +#  Copyright (C) 2018 Bloomberg Finance LP
    
    4
    +#
    
    5
    +#  This program is free software; you can redistribute it and/or
    
    6
    +#  modify it under the terms of the GNU Lesser General Public
    
    7
    +#  License as published by the Free Software Foundation; either
    
    8
    +#  version 2 of the License, or (at your option) any later version.
    
    9
    +#
    
    10
    +#  This library is distributed in the hope that it will be useful,
    
    11
    +#  but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    12
    +#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    
    13
    +#  Lesser General Public License for more details.
    
    14
    +#
    
    15
    +#  You should have received a copy of the GNU Lesser General Public
    
    16
    +#  License along with this library. If not, see <http://www.gnu.org/licenses/>.
    
    17
    +#
    
    18
    +#  Authors: Tristan Van Berkom <tristan vanberkom codethink co uk>
    
    19
    +#           Sam Thursfield <sam thursfield codethink co uk>
    
    20
    +#           Jürg Billeter <juerg billeter codethink co uk>
    
    21
    +#
    
    22
    +
    
    1 23
     import os
    
    2 24
     import pytest
    
    3 25
     
    
    4 26
     from buildstream._exceptions import ErrorDomain
    
    5 27
     from tests.testutils import cli, create_artifact_share, create_element_size
    
    6
    -from tests.testutils import generate_junction
    
    28
    +from tests.testutils import generate_junction, wait_for_cache_granularity
    
    7 29
     from . import configure_project
    
    8 30
     
    
    9 31
     
    
    ... ... @@ -327,6 +349,8 @@ def test_recently_pulled_artifact_does_not_expire(cli, datafiles, tmpdir):
    327 349
             # Ensure element1 is cached locally
    
    328 350
             assert cli.get_element_state(project, 'element1.bst') == 'cached'
    
    329 351
     
    
    352
    +        wait_for_cache_granularity()
    
    353
    +
    
    330 354
             # Create and build the element3 (of 5 MB)
    
    331 355
             create_element_size('element3.bst', project, element_path, [], int(5e6))
    
    332 356
             result = cli.run(project=project, args=['build', 'element3.bst'])
    

  • tests/frontend/workspace.py
    1
    +#
    
    2
    +#  Copyright (C) 2018 Codethink Limited
    
    3
    +#  Copyright (C) 2018 Bloomberg Finance LP
    
    4
    +#
    
    5
    +#  This program is free software; you can redistribute it and/or
    
    6
    +#  modify it under the terms of the GNU Lesser General Public
    
    7
    +#  License as published by the Free Software Foundation; either
    
    8
    +#  version 2 of the License, or (at your option) any later version.
    
    9
    +#
    
    10
    +#  This library is distributed in the hope that it will be useful,
    
    11
    +#  but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    12
    +#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    
    13
    +#  Lesser General Public License for more details.
    
    14
    +#
    
    15
    +#  You should have received a copy of the GNU Lesser General Public
    
    16
    +#  License along with this library. If not, see <http://www.gnu.org/licenses/>.
    
    17
    +#
    
    18
    +#  Authors: Tristan Van Berkom <tristan vanberkom codethink co uk>
    
    19
    +#           Tristan Maat <tristan maat codethink co uk>
    
    20
    +#           Chandan Singh <csingh43 bloomberg net>
    
    21
    +#           Phillip Smyth <phillip smyth codethink co uk>
    
    22
    +#           Jonathan Maw <jonathan maw codethink co uk>
    
    23
    +#           Richard Maw <richard maw codethink co uk>
    
    24
    +#
    
    25
    +
    
    1 26
     import os
    
    2 27
     import pytest
    
    3 28
     import shutil
    
    4 29
     import subprocess
    
    5 30
     from ruamel.yaml.comments import CommentedSet
    
    6
    -from tests.testutils import cli, create_repo, ALL_REPO_KINDS
    
    31
    +from tests.testutils import cli, create_repo, ALL_REPO_KINDS, wait_for_cache_granularity
    
    7 32
     
    
    8 33
     from buildstream import _yaml
    
    9 34
     from buildstream._exceptions import ErrorDomain, LoadError, LoadErrorReason
    
    ... ... @@ -507,6 +532,8 @@ def test_detect_modifications(cli, tmpdir, datafiles, modification, strict):
    507 532
         assert cli.get_element_state(project, element_name) == 'cached'
    
    508 533
         assert cli.get_element_key(project, element_name) != "{:?<64}".format('')
    
    509 534
     
    
    535
    +    wait_for_cache_granularity()
    
    536
    +
    
    510 537
         # Modify the workspace in various different ways, ensuring we
    
    511 538
         # properly detect the changes.
    
    512 539
         #
    

  • tests/sources/git.py
    1
    +#
    
    2
    +#  Copyright (C) 2018 Codethink Limited
    
    3
    +#  Copyright (C) 2018 Bloomberg Finance LP
    
    4
    +#
    
    5
    +#  This program is free software; you can redistribute it and/or
    
    6
    +#  modify it under the terms of the GNU Lesser General Public
    
    7
    +#  License as published by the Free Software Foundation; either
    
    8
    +#  version 2 of the License, or (at your option) any later version.
    
    9
    +#
    
    10
    +#  This library is distributed in the hope that it will be useful,
    
    11
    +#  but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    12
    +#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    
    13
    +#  Lesser General Public License for more details.
    
    14
    +#
    
    15
    +#  You should have received a copy of the GNU Lesser General Public
    
    16
    +#  License along with this library. If not, see <http://www.gnu.org/licenses/>.
    
    17
    +#
    
    18
    +#  Authors: Tristan Van Berkom <tristan vanberkom codethink co uk>
    
    19
    +#           Jonathan Maw <jonathan maw codethink co uk>
    
    20
    +#           William Salmon <will salmon codethink co uk>
    
    21
    +#
    
    22
    +
    
    1 23
     import os
    
    2 24
     import pytest
    
    3 25
     
    
    ... ... @@ -383,21 +405,6 @@ def test_submodule_track_no_ref_or_track(cli, tmpdir, datafiles):
    383 405
         _yaml.dump(element, os.path.join(project, 'target.bst'))
    
    384 406
     
    
    385 407
         # Track will encounter an inconsistent submodule without any ref
    
    386
    -    result = cli.run(project=project, args=['track', 'target.bst'])
    
    387
    -    result.assert_main_error(ErrorDomain.STREAM, None)
    
    388
    -    result.assert_task_error(ErrorDomain.SOURCE, 'track-attempt-no-track')
    
    389
    -
    
    390
    -    # Assert that we are just fine without it, and emit a warning to the user.
    
    391
    -    assert "FAILURE git source at" in result.stderr
    
    392
    -    assert "Without a tracking branch ref can not be updated. Please " + \
    
    393
    -        "provide a ref or a track." in result.stderr
    
    394
    -
    
    395
    -    # Track will encounter an inconsistent submodule without any ref
    
    396
    -    result = cli.run(project=project, args=['build', 'target.bst'])
    
    397
    -    result.assert_main_error(ErrorDomain.PIPELINE, 'inconsistent-pipeline')
    
    408
    +    result = cli.run(project=project, args=['show', 'target.bst'])
    
    409
    +    result.assert_main_error(ErrorDomain.SOURCE, "missing-track-and-ref")
    
    398 410
         result.assert_task_error(None, None)
    399
    -
    
    400
    -    # Assert that we are just fine without it, and emit a warning to the user.
    
    401
    -    assert "Exact versions are missing for the following elements" in result.stderr
    
    402
    -    assert "is missing ref and track." in result.stderr
    
    403
    -    assert "Then track these elements with `bst track`" in result.stderr

  • tests/sources/ostree.py
    1
    +#
    
    2
    +#  Copyright (C) 2018 Bloomberg Finance LP
    
    3
    +#
    
    4
    +#  This program is free software; you can redistribute it and/or
    
    5
    +#  modify it under the terms of the GNU Lesser General Public
    
    6
    +#  License as published by the Free Software Foundation; either
    
    7
    +#  version 2 of the License, or (at your option) any later version.
    
    8
    +#
    
    9
    +#  This library is distributed in the hope that it will be useful,
    
    10
    +#  but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    11
    +#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    
    12
    +#  Lesser General Public License for more details.
    
    13
    +#
    
    14
    +#  You should have received a copy of the GNU Lesser General Public
    
    15
    +#  License along with this library. If not, see <http://www.gnu.org/licenses/>.
    
    16
    +#
    
    17
    +#  Authors: William Salmon <will salmon codethink co uk>
    
    18
    +#
    
    19
    +
    
    20
    +import os
    
    21
    +import pytest
    
    22
    +
    
    23
    +from buildstream._exceptions import ErrorDomain
    
    24
    +from buildstream import _yaml
    
    25
    +
    
    26
    +from tests.testutils import cli, create_repo
    
    27
    +
    
    28
    +DATA_DIR = os.path.join(
    
    29
    +    os.path.dirname(os.path.realpath(__file__)),
    
    30
    +    'ostree',
    
    31
    +)
    
    32
    +
    
    33
    +
    
    34
    +@pytest.mark.datafiles(os.path.join(DATA_DIR, 'template'))
    
    35
    +def test_submodule_track_no_ref_or_track(cli, tmpdir, datafiles):
    
    36
    +    project = os.path.join(datafiles.dirname, datafiles.basename)
    
    37
    +
    
    38
    +    # Create the repo from 'repofiles' subdir
    
    39
    +    repo = create_repo('ostree', str(tmpdir))
    
    40
    +    ref = repo.create(os.path.join(project, 'repofiles'))
    
    41
    +
    
    42
    +    # Write out our test target
    
    43
    +    ostreesource = repo.source_config(ref=None)
    
    44
    +    ostreesource.pop('track')
    
    45
    +    element = {
    
    46
    +        'kind': 'import',
    
    47
    +        'sources': [
    
    48
    +            ostreesource
    
    49
    +        ]
    
    50
    +    }
    
    51
    +
    
    52
    +    _yaml.dump(element, os.path.join(project, 'target.bst'))
    
    53
    +
    
    54
    +    # Track will encounter an inconsistent submodule without any ref
    
    55
    +    result = cli.run(project=project, args=['show', 'target.bst'])
    
    56
    +    result.assert_main_error(ErrorDomain.SOURCE, "missing-track-and-ref")
    
    57
    +    result.assert_task_error(None, None)

  • tests/sources/ostree/template/project.conf
    1
    +# Basic project
    
    2
    +name: foo

  • tests/sources/ostree/template/repofiles/file

  • tests/testutils/__init__.py
    1
    +#
    
    2
    +#  Copyright (C) 2018 Codethink Limited
    
    3
    +#  Copyright (C) 2018 Bloomberg Finance LP
    
    4
    +#
    
    5
    +#  This program is free software; you can redistribute it and/or
    
    6
    +#  modify it under the terms of the GNU Lesser General Public
    
    7
    +#  License as published by the Free Software Foundation; either
    
    8
    +#  version 2 of the License, or (at your option) any later version.
    
    9
    +#
    
    10
    +#  This library is distributed in the hope that it will be useful,
    
    11
    +#  but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    12
    +#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    
    13
    +#  Lesser General Public License for more details.
    
    14
    +#
    
    15
    +#  You should have received a copy of the GNU Lesser General Public
    
    16
    +#  License along with this library. If not, see <http://www.gnu.org/licenses/>.
    
    17
    +#
    
    18
    +#  Authors: Tristan Van Berkom <tristan vanberkom codethink co uk>
    
    19
    +#           Tristan Maat <tristan maat codethink co uk>
    
    20
    +#           Sam Thursfield <sam thursfield codethink co uk>
    
    21
    +#           James Ennis <james ennis codethink co uk>
    
    22
    +#           Valentin David <valentin david codethink co uk>
    
    23
    +#           William Salmon <will salmon codethink co uk>
    
    24
    +#
    
    25
    +
    
    1 26
     from .runcli import cli, cli_integration
    
    2 27
     from .repo import create_repo, ALL_REPO_KINDS
    
    3 28
     from .artifactshare import create_artifact_share
    
    4 29
     from .element_generators import create_element_size
    
    5 30
     from .junction import generate_junction
    
    31
    +from .runner_integration import wait_for_cache_granularity

  • tests/testutils/runner_integration.py
    1
    +#
    
    2
    +#  Copyright (C) 2018 Bloomberg Finance LP
    
    3
    +#
    
    4
    +#  This program is free software; you can redistribute it and/or
    
    5
    +#  modify it under the terms of the GNU Lesser General Public
    
    6
    +#  License as published by the Free Software Foundation; either
    
    7
    +#  version 2 of the License, or (at your option) any later version.
    
    8
    +#
    
    9
    +#  This library is distributed in the hope that it will be useful,
    
    10
    +#  but WITHOUT ANY WARRANTY; without even the implied warranty of
    
    11
    +#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    
    12
    +#  Lesser General Public License for more details.
    
    13
    +#
    
    14
    +#  You should have received a copy of the GNU Lesser General Public
    
    15
    +#  License along with this library. If not, see <http://www.gnu.org/licenses/>.
    
    16
    +#
    
    17
    +#  Authors:
    
    18
    +#         Will Salmon <will salmon codethink co uk>
    
    19
    +
    
    20
    +import time
    
    21
    +
    
    22
    +
    
    23
    +def wait_for_cache_granularity():
    
    24
    +    # This isn't called very often so has minimal impact on test runtime.
    
    25
    +    # If this changes it may be worth while adding a more sophisticated approach.
    
    26
    +    """
    
    27
    +    Mitigate the coarse granularity of the gitlab runners mtime
    
    28
    +
    
    29
    +    This function waits for the mtime to increment so that the cache can sort by mtime and
    
    30
    +    get the most recent results.
    
    31
    +    """
    
    32
    +    time.sleep(1.1)



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