mirror of
https://github.com/ostreedev/ostree.git
synced 2025-02-03 17:47:40 +03:00
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> Closes: #1457 Approved by: cgwalters
This commit is contained in:
parent
02dc5e2dd4
commit
98b597b465
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user