Skip to content

Commit fc71aba

Browse files
devin-ai-integration[bot]bot_apk
andcommitted
refactor(cdk): make DEFAULT_CHECK_INTERVAL private and drop circular tests
Co-Authored-By: bot_apk <apk@cognition.ai>
1 parent a021eb7 commit fc71aba

2 files changed

Lines changed: 2 additions & 13 deletions

File tree

airbyte_cdk/utils/memory_monitor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
_DEFAULT_CRITICAL_THRESHOLD = 0.95
2727

2828
# Check interval (every N messages)
29-
DEFAULT_CHECK_INTERVAL = 1000
29+
_DEFAULT_CHECK_INTERVAL = 1000
3030

3131

3232
class MemoryLimitExceeded(AirbyteTracedException):
@@ -47,7 +47,7 @@ def __init__(
4747
self,
4848
warning_threshold: float = _DEFAULT_WARNING_THRESHOLD,
4949
critical_threshold: float = _DEFAULT_CRITICAL_THRESHOLD,
50-
check_interval: int = DEFAULT_CHECK_INTERVAL,
50+
check_interval: int = _DEFAULT_CHECK_INTERVAL,
5151
) -> None:
5252
self._warning_threshold = warning_threshold
5353
self._critical_threshold = critical_threshold

unit_tests/utils/test_memory_monitor.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
_CGROUP_V1_USAGE,
1414
_CGROUP_V2_CURRENT,
1515
_CGROUP_V2_MAX,
16-
DEFAULT_CHECK_INTERVAL,
1716
MemoryLimitExceeded,
1817
MemoryMonitor,
1918
)
@@ -389,13 +388,3 @@ def test_default_attributes(self) -> None:
389388
assert exc.failure_type == FailureType.system_error
390389
assert exc.message == "Source exceeded memory limit."
391390
assert exc.internal_message == "Memory at 96%"
392-
393-
394-
class TestDefaultCheckInterval:
395-
"""Tests for the DEFAULT_CHECK_INTERVAL constant."""
396-
397-
def test_check_interval_is_positive(self) -> None:
398-
assert DEFAULT_CHECK_INTERVAL > 0
399-
400-
def test_check_interval_value(self) -> None:
401-
assert DEFAULT_CHECK_INTERVAL == 1000

0 commit comments

Comments
 (0)