renamed onionr dir and bugfixes/linting progress
This commit is contained in:
parent
2b996da17f
commit
720efe4fca
226 changed files with 179 additions and 142 deletions
16
src/runtests/stresstest.py
Normal file
16
src/runtests/stresstest.py
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import os
|
||||
|
||||
import onionrblocks
|
||||
import logger
|
||||
import coredb
|
||||
from onionrutils import epoch
|
||||
|
||||
def stress_test_block_insert(testmanager):
|
||||
start = epoch.get_epoch()
|
||||
count = 100
|
||||
max_insert_speed = 120
|
||||
for x in range(count): onionrblocks.insert(os.urandom(32))
|
||||
speed = epoch.get_epoch() - start
|
||||
if speed < max_insert_speed:
|
||||
raise ValueError(f'{count} blocks inserted too fast, {max_insert_speed}, got {speed}')
|
||||
logger.info(f'runtest stress block insertion: {count} blocks inserted in {speed}s')
|
||||
Loading…
Add table
Add a link
Reference in a new issue