mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-15 06:36:40 +00:00
Add benchmark for parallel uploads.
This commit is contained in:
parent
b477c59e15
commit
c371a1f6b3
@ -38,6 +38,7 @@ from tempfile import mkdtemp
|
||||
import os
|
||||
|
||||
from twisted.trial.unittest import TestCase
|
||||
from twisted.internet.defer import gatherResults
|
||||
|
||||
from allmydata.util.deferredutil import async_to_deferred
|
||||
from allmydata.util.consumer import MemoryConsumer
|
||||
@ -112,3 +113,13 @@ class ImmutableBenchmarks(SystemTestMixin, TestCase):
|
||||
with timeit("download"):
|
||||
data = await result.download_best_version()
|
||||
self.assertEqual(data, DATA)
|
||||
|
||||
@async_to_deferred
|
||||
async def test_upload_mutable_in_parallel(self):
|
||||
# To test larger files, change this:
|
||||
DATA = b"Some data to upload\n" * 1_000_000
|
||||
with timeit(" upload"):
|
||||
await gatherResults([
|
||||
self.clients[0].create_mutable_file(MutableData(DATA))
|
||||
for _ in range(20)
|
||||
])
|
||||
|
Loading…
x
Reference in New Issue
Block a user