Skip to content

Commit

Permalink
fixup! use different values for read/write chunk size in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioSim committed Nov 29, 2023
1 parent 8f6a264 commit b2a6064
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions tests/backends/data/test_async_es.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async def test_backends_data_async_es_instantiation_with_settings():
POINT_IN_TIME_KEEP_ALIVE="5m",
READ_CHUNK_SIZE=5000,
REFRESH_AFTER_WRITE=True,
WRITE_CHUNK_SIZE=5000,
WRITE_CHUNK_SIZE=4999,
)
backend = AsyncESDataBackend(settings)
assert backend.settings.ALLOW_YELLOW_STATUS
Expand All @@ -108,7 +108,7 @@ async def test_backends_data_async_es_instantiation_with_settings():
assert backend.settings.POINT_IN_TIME_KEEP_ALIVE == "5m"
assert backend.settings.READ_CHUNK_SIZE == 5000
assert backend.settings.REFRESH_AFTER_WRITE
assert backend.settings.WRITE_CHUNK_SIZE == 5000
assert backend.settings.WRITE_CHUNK_SIZE == 4999
assert isinstance(backend.client, AsyncElasticsearch)
elasticsearch_node = backend.client.transport.node_pool.get()
assert elasticsearch_node.host == "elasticsearch_hostname"
Expand Down
2 changes: 1 addition & 1 deletion tests/backends/data/test_async_mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ async def test_backends_data_async_mongo_instantiation_with_settings(
assert backend.settings.CLIENT_OPTIONS == MongoClientOptions()
assert backend.settings.LOCALE_ENCODING == "utf8"
assert backend.settings.READ_CHUNK_SIZE == 500
assert backend.settings.WRITE_CHUNK_SIZE == 500
assert backend.settings.WRITE_CHUNK_SIZE == 499


@pytest.mark.anyio
Expand Down
4 changes: 2 additions & 2 deletions tests/backends/data/test_clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ def test_backends_data_clickhouse_instantiation_with_settings():
},
LOCALE_ENCODING="utf-16",
READ_CHUNK_SIZE=1000,
WRITE_CHUNK_SIZE=1000,
WRITE_CHUNK_SIZE=999,
)
backend = ClickHouseDataBackend(settings)

assert isinstance(backend.client, HttpClient)
assert backend.event_table_name == CLICKHOUSE_TEST_TABLE_NAME
assert backend.settings.LOCALE_ENCODING == "utf-16"
assert backend.settings.READ_CHUNK_SIZE == 1000
assert backend.settings.WRITE_CHUNK_SIZE == 1000
assert backend.settings.WRITE_CHUNK_SIZE == 999
backend.close()


Expand Down
4 changes: 2 additions & 2 deletions tests/backends/data/test_es.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def test_backends_data_es_instantiation_with_settings():
POINT_IN_TIME_KEEP_ALIVE="5m",
READ_CHUNK_SIZE=5000,
REFRESH_AFTER_WRITE=True,
WRITE_CHUNK_SIZE=5000,
WRITE_CHUNK_SIZE=4999,
)
backend = ESDataBackend(settings)
assert backend.settings.ALLOW_YELLOW_STATUS
Expand All @@ -105,7 +105,7 @@ def test_backends_data_es_instantiation_with_settings():
assert backend.settings.POINT_IN_TIME_KEEP_ALIVE == "5m"
assert backend.settings.READ_CHUNK_SIZE == 5000
assert backend.settings.REFRESH_AFTER_WRITE
assert backend.settings.WRITE_CHUNK_SIZE == 5000
assert backend.settings.WRITE_CHUNK_SIZE == 4999
assert isinstance(backend.client, Elasticsearch)
elasticsearch_node = backend.client.transport.node_pool.get()
assert elasticsearch_node.config.ca_certs == Path("/path/to/ca/bundle")
Expand Down
4 changes: 2 additions & 2 deletions tests/backends/data/test_fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def test_backends_data_fs_instantiation_with_settings(fs):
DEFAULT_QUERY_STRING="foo.txt",
LOCALE_ENCODING="utf-16",
READ_CHUNK_SIZE=1,
WRITE_CHUNK_SIZE=1,
WRITE_CHUNK_SIZE=9,
)
backend = FSDataBackend(settings)
assert os.path.exists(deep_path)
Expand All @@ -65,7 +65,7 @@ def test_backends_data_fs_instantiation_with_settings(fs):
assert backend.default_query_string == "foo.txt"
assert backend.settings.LOCALE_ENCODING == "utf-16"
assert backend.settings.READ_CHUNK_SIZE == 1
assert backend.settings.WRITE_CHUNK_SIZE == 1
assert backend.settings.WRITE_CHUNK_SIZE == 9

try:
FSDataBackend(settings)
Expand Down
2 changes: 1 addition & 1 deletion tests/backends/data/test_ldp.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def test_backends_data_ldp_instantiation_with_settings(ldp_backend):
assert backend.service_name == "foo"
assert backend.stream_id == "bar"
assert backend.settings.READ_CHUNK_SIZE == 500
assert backend.settings.WRITE_CHUNK_SIZE == 500
assert backend.settings.WRITE_CHUNK_SIZE == 499

try:
ldp_backend(service_name="bar")
Expand Down
4 changes: 2 additions & 2 deletions tests/backends/data/test_mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_backends_data_mongo_instantiation_with_settings():
CLIENT_OPTIONS={"tz_aware": "True"},
LOCALE_ENCODING="utf8",
READ_CHUNK_SIZE=1000,
WRITE_CHUNK_SIZE=1000,
WRITE_CHUNK_SIZE=999,
)
backend = MongoDataBackend(settings)
assert backend.database.name == MONGO_TEST_DATABASE
Expand All @@ -79,7 +79,7 @@ def test_backends_data_mongo_instantiation_with_settings():
assert backend.settings.CLIENT_OPTIONS == MongoClientOptions(tz_aware=True)
assert backend.settings.LOCALE_ENCODING == "utf8"
assert backend.settings.READ_CHUNK_SIZE == 1000
assert backend.settings.WRITE_CHUNK_SIZE == 1000
assert backend.settings.WRITE_CHUNK_SIZE == 999

try:
MongoDataBackend(settings)
Expand Down
4 changes: 2 additions & 2 deletions tests/backends/data/test_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ def test_backends_data_s3_instantiation_with_settings():
DEFAULT_BUCKET_NAME="bucket",
LOCALE_ENCODING="utf-16",
READ_CHUNK_SIZE=1000,
WRITE_CHUNK_SIZE=1000,
WRITE_CHUNK_SIZE=999,
)
backend = S3DataBackend(settings_)
assert backend.default_bucket_name == "bucket"
assert backend.settings.LOCALE_ENCODING == "utf-16"
assert backend.settings.READ_CHUNK_SIZE == 1000
assert backend.settings.WRITE_CHUNK_SIZE == 1000
assert backend.settings.WRITE_CHUNK_SIZE == 999

try:
S3DataBackend(settings_)
Expand Down
4 changes: 2 additions & 2 deletions tests/backends/data/test_swift.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def test_backends_data_swift_instantiation_with_settings(fs):
DEFAULT_CONTAINER="default_container",
LOCALE_ENCODING="utf-16",
READ_CHUNK_SIZE=300,
WRITE_CHUNK_SIZE=300,
WRITE_CHUNK_SIZE=299,
)
backend = SwiftDataBackend(settings_)
assert backend.options["tenant_id"] == "tenant_id"
Expand All @@ -98,7 +98,7 @@ def test_backends_data_swift_instantiation_with_settings(fs):
assert backend.default_container == "default_container"
assert backend.locale_encoding == "utf-16"
assert backend.settings.READ_CHUNK_SIZE == 300
assert backend.settings.WRITE_CHUNK_SIZE == 300
assert backend.settings.WRITE_CHUNK_SIZE == 299

try:
SwiftDataBackend(settings_)
Expand Down
30 changes: 15 additions & 15 deletions tests/fixtures/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def get_async_es_test_backend(index: str = ES_TEST_INDEX):
POINT_IN_TIME_KEEP_ALIVE="1m",
READ_CHUNK_SIZE=500,
REFRESH_AFTER_WRITE=True,
WRITE_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=499,
)
return AsyncESLRSBackend(settings)

Expand Down Expand Up @@ -156,7 +156,7 @@ def get_async_mongo_test_backend(
CLIENT_OPTIONS=client_options if client_options else {},
LOCALE_ENCODING="utf8",
READ_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=499,
)
return AsyncMongoLRSBackend(settings)

Expand Down Expand Up @@ -208,7 +208,7 @@ def get_fs_data_backend(path: str = "foo"):
DEFAULT_QUERY_STRING="*",
LOCALE_ENCODING="utf8",
READ_CHUNK_SIZE=1024,
WRITE_CHUNK_SIZE=1024,
WRITE_CHUNK_SIZE=999,
)
return FSDataBackend(settings)

Expand All @@ -228,7 +228,7 @@ def get_fs_lrs_backend(path: str = "foo"):
DEFAULT_QUERY_STRING="*",
LOCALE_ENCODING="utf8",
READ_CHUNK_SIZE=1024,
WRITE_CHUNK_SIZE=1024,
WRITE_CHUNK_SIZE=999,
)
return FSLRSBackend(settings)

Expand Down Expand Up @@ -258,7 +258,7 @@ def get_mongo_data_backend(
CLIENT_OPTIONS=client_options if client_options else {},
LOCALE_ENCODING="utf8",
READ_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=499,
)
return AsyncMongoDataBackend(settings)

Expand Down Expand Up @@ -322,7 +322,7 @@ def get_mongo_data_backend(
CLIENT_OPTIONS=client_options if client_options else {},
LOCALE_ENCODING="utf8",
READ_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=499,
)
return MongoDataBackend(settings)

Expand All @@ -346,7 +346,7 @@ def get_mongo_lrs_backend(
CLIENT_OPTIONS=client_options if client_options else {},
LOCALE_ENCODING="utf8",
READ_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=499,
)
return MongoLRSBackend(settings)

Expand Down Expand Up @@ -498,7 +498,7 @@ def get_ldp_data_backend(service_name: str = "foo", stream_id: str = "bar"):
SERVICE_NAME=service_name,
REQUEST_TIMEOUT=None,
READ_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=499,
)
return LDPDataBackend(settings)

Expand All @@ -519,7 +519,7 @@ def get_async_es_data_backend():
LOCALE_ENCODING="utf8",
READ_CHUNK_SIZE=500,
REFRESH_AFTER_WRITE=True,
WRITE_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=499,
)
return AsyncESDataBackend(settings)

Expand Down Expand Up @@ -553,7 +553,7 @@ def get_clickhouse_data_backend():
},
LOCALE_ENCODING="utf8",
READ_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=499,
)
return ClickHouseDataBackend(settings)

Expand All @@ -579,7 +579,7 @@ def get_clickhouse_lrs_backend():
LOCALE_ENCODING="utf8",
IDS_CHUNK_SIZE=10000,
READ_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=499,
)
return ClickHouseLRSBackend(settings)

Expand All @@ -600,7 +600,7 @@ def get_es_data_backend():
LOCALE_ENCODING="utf8",
READ_CHUNK_SIZE=500,
REFRESH_AFTER_WRITE=True,
WRITE_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=499,
)
return ESDataBackend(settings)

Expand All @@ -622,7 +622,7 @@ def get_es_lrs_backend(index: str = ES_TEST_INDEX):
POINT_IN_TIME_KEEP_ALIVE="1m",
READ_CHUNK_SIZE=500,
REFRESH_AFTER_WRITE=True,
WRITE_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=499,
)
return ESLRSBackend(settings)

Expand All @@ -649,7 +649,7 @@ def get_swift_data_backend():
DEFAULT_CONTAINER="container_name",
LOCALE_ENCODING="utf8",
READ_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=500,
WRITE_CHUNK_SIZE=499,
)
return SwiftDataBackend(settings)

Expand Down Expand Up @@ -680,7 +680,7 @@ def get_s3_data_backend():
DEFAULT_BUCKET_NAME="bucket_name",
LOCALE_ENCODING="utf8",
READ_CHUNK_SIZE=4096,
WRITE_CHUNK_SIZE=4096,
WRITE_CHUNK_SIZE=3999,
)
return S3DataBackend(settings)

Expand Down

0 comments on commit b2a6064

Please sign in to comment.