53 lines
1.6 KiB
Diff
53 lines
1.6 KiB
Diff
From: Simon McVittie <smcv@debian.org>
|
|
Date: Wed, 17 Jan 2018 15:03:59 +0000
|
|
Subject: test-concurrency: Explicitly use floor division
|
|
|
|
Python 3 is pickier about this. Python 2.7 has Python 3-compatible
|
|
semantics for division when the division feature is imported from the
|
|
future.
|
|
|
|
Signed-off-by: Simon McVittie <smcv@debian.org>
|
|
Applied-upstream: 2018.3, commit:98b597b465a556f3ad5b16478d7edee3037fbd4d
|
|
---
|
|
tests/test-concurrency.py | 9 +++++----
|
|
1 file changed, 5 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/tests/test-concurrency.py b/tests/test-concurrency.py
|
|
index f16f696..3a0ce10 100755
|
|
--- a/tests/test-concurrency.py
|
|
+++ b/tests/test-concurrency.py
|
|
@@ -17,6 +17,7 @@
|
|
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
# Boston, MA 02111-1307, USA.
|
|
|
|
+from __future__ import division
|
|
from __future__ import print_function
|
|
import os
|
|
import sys
|
|
@@ -78,12 +79,12 @@ def run(n_committers, n_pruners):
|
|
pruners = set()
|
|
|
|
print('n_committers', n_committers, 'n_pruners', n_pruners, file=sys.stderr)
|
|
- n_trees = n_committers / 2
|
|
+ n_trees = n_committers // 2
|
|
for v in range(n_trees):
|
|
mktree('tree{}'.format(v))
|
|
|
|
for v in range(n_committers):
|
|
- committers.add(commit(v / 2))
|
|
+ committers.add(commit(v // 2))
|
|
for v in range(n_pruners):
|
|
pruners.add(prune())
|
|
|
|
@@ -101,8 +102,8 @@ def run(n_committers, n_pruners):
|
|
shutil.rmtree('tree{}'.format(v))
|
|
|
|
# No concurrent pruning
|
|
-run(cpu_count()/2 + 2, 0)
|
|
+run(cpu_count() // 2 + 2, 0)
|
|
print("ok no concurrent prunes")
|
|
|
|
-run(cpu_count()/2 + 4, 3)
|
|
+run(cpu_count() // 2 + 4, 3)
|
|
print("ok concurrent prunes")
|