]> arthur.barton.de Git - bup.git/commitdiff
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)
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

index 6adea5b80a6859e3eee57695a1f59d667bcec6c3..c460e821c677adbe7ac5c15ac5adb828a765f715 100755 (executable)
@@ -155,6 +155,7 @@ with test_tempdir('prune-older-') as tmpdir:
     three_years_ago = now - (60 * 60 * 24 * 366 * 3)
     chdir(tmpdir)
     ex(['git', 'init', 'work'])
+    ex(['git', 'config', 'gc.autoDetach', 'false'])
 
     wvstart('generating ' + str(save_population) + ' random saves')
     chdir(tmpdir + '/work')