]> arthur.barton.de Git - bup.git/commit
test-prune-older: disable background gc
authorRob Browning <rlb@defaultvalue.org>
Tue, 20 Aug 2019 01:34:11 +0000 (20:34 -0500)
committerRob Browning <rlb@defaultvalue.org>
Thu, 22 Aug 2019 01:22:56 +0000 (20:22 -0500)
commit45136f27bb239a48d696e21d0754cec87e8b05ef
treec8f64a6184f23002e97b1a138d1c3900a522a063
parentf312dc0e4f4860a11b60dd48866221393be8228d
test-prune-older: disable background gc

The debian buildd's exposed a race between the default automatic
background gc and the explict gc in the test, resulting in:

  git commit --date 1566025987 -qam 1566025987
  Auto packing the repository in background for optimum performance.
  See "git help gc" for manual housekeeping.
  git gc --aggressive
  fatal: gc is already running on machine 'zandonai' pid 34323 (use --force if not)
  Traceback (most recent call last):
    File "t/test-prune-older", line 190, in <module>
      save_utcs = create_older_random_saves(save_population, three_years_ago, now)
    File "t/test-prune-older", line 74, in create_older_random_saves
      exc(['git', 'gc', '--aggressive'])
    File "t/test-prune-older", line 41, in exc
      check_call(cmd, shell=shell)
    File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
      raise CalledProcessError(retcode, cmd)
  subprocess.CalledProcessError: Command '['git', 'gc', '--aggressive']' returned non-zero exit status 128

Fix it by disabling gc.autoDetach in the git config for the test repo
-- something we may well need to do in other tests too.

Thanks to Robert Edmonds for reporting the problem and suggesting the
fix.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
t/test-prune-older