-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #656 from aiven/jjaakola-aiven-fix-producer-max-co…
…nfig-on-aiohttp-application fix: set aiohttp Application client max size according with producer config
- Loading branch information
Showing
5 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
""" | ||
Test config | ||
Copyright (c) 2023 Aiven Ltd | ||
See LICENSE for details | ||
""" | ||
from karapace.config import set_config_defaults | ||
from karapace.constants import DEFAULT_AIOHTTP_CLIENT_MAX_SIZE, DEFAULT_PRODUCER_MAX_REQUEST | ||
|
||
|
||
def test_http_request_max_size() -> None: | ||
config = set_config_defaults( | ||
{ | ||
"karapace_rest": False, | ||
"producer_max_request_size": DEFAULT_PRODUCER_MAX_REQUEST + 1024, | ||
} | ||
) | ||
assert config["http_request_max_size"] == DEFAULT_AIOHTTP_CLIENT_MAX_SIZE | ||
|
||
config = set_config_defaults( | ||
{ | ||
"karapace_rest": False, | ||
"http_request_max_size": 1024, | ||
} | ||
) | ||
assert config["http_request_max_size"] == 1024 | ||
|
||
config = set_config_defaults( | ||
{ | ||
"karapace_rest": True, | ||
} | ||
) | ||
assert config["http_request_max_size"] == DEFAULT_AIOHTTP_CLIENT_MAX_SIZE | ||
|
||
config = set_config_defaults( | ||
{ | ||
"karapace_rest": True, | ||
"producer_max_request_size": 1024, | ||
} | ||
) | ||
assert config["http_request_max_size"] == DEFAULT_AIOHTTP_CLIENT_MAX_SIZE | ||
|
||
config = set_config_defaults( | ||
{ | ||
"karapace_rest": True, | ||
"producer_max_request_size": DEFAULT_PRODUCER_MAX_REQUEST + 1024, | ||
} | ||
) | ||
assert config["http_request_max_size"] == DEFAULT_PRODUCER_MAX_REQUEST + 1024 + DEFAULT_AIOHTTP_CLIENT_MAX_SIZE | ||
|
||
config = set_config_defaults( | ||
{ | ||
"karapace_rest": True, | ||
"producer_max_request_size": DEFAULT_PRODUCER_MAX_REQUEST + 1024, | ||
"http_request_max_size": 1024, | ||
} | ||
) | ||
assert config["http_request_max_size"] == 1024 |