mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-03 19:42:55 +00:00
minor code beautification
This commit is contained in:
committed by
Stas Kelvich
parent
ec673a5d67
commit
fbd8ca2ff4
@@ -10,13 +10,14 @@ from fixtures.zenith_fixtures import (
|
||||
|
||||
pytest_plugins = ("fixtures.benchmark_fixture")
|
||||
|
||||
# Run bulk tenant cration test.
|
||||
# Run bulk tenant creation test.
|
||||
#
|
||||
# Collects metrics:
|
||||
#
|
||||
# 1. Time to create {1,10,50} tenants
|
||||
# 2. Average creation time per tenant
|
||||
|
||||
|
||||
@pytest.mark.parametrize('tenants_count', [1, 10, 50])
|
||||
def test_bulk_tenant_create(
|
||||
zenith_cli: ZenithCli,
|
||||
@@ -29,7 +30,9 @@ def test_bulk_tenant_create(
|
||||
start = timeit.default_timer()
|
||||
for i in range(tenants_count):
|
||||
tenant = tenant_factory.create()
|
||||
zenith_cli.run(["branch", f"test_bulk_tenant_create_{tenants_count}_{i}", "main", f"--tenantid={tenant}"])
|
||||
zenith_cli.run([
|
||||
"branch", f"test_bulk_tenant_create_{tenants_count}_{i}", "main", f"--tenantid={tenant}"
|
||||
])
|
||||
pg_tenant = postgres.create_start(
|
||||
f"test_bulk_tenant_create_{tenants_count}_{i}",
|
||||
tenant,
|
||||
@@ -38,7 +41,7 @@ def test_bulk_tenant_create(
|
||||
with closing(pg_tenant.connect()) as conn:
|
||||
with conn.cursor() as cur:
|
||||
cur.execute("SELECT 1;")
|
||||
assert cur.fetchone() == (1,)
|
||||
assert cur.fetchone() == (1, )
|
||||
end = timeit.default_timer()
|
||||
|
||||
zenbenchmark.record('tenant_creation_time_total', end - start, 's')
|
||||
|
||||
Reference in New Issue
Block a user