Изменена логика задания таймаутов ожидания
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import asyncio
|
||||
|
||||
from config_manager.v2 import ConfigManagerV2
|
||||
from config_manager.v2 import ConfigManagerV2, ManagementServerSettings
|
||||
|
||||
|
||||
class DemoApp(ConfigManagerV2):
|
||||
DEFAULT_UPDATE_INTERVAL = 0.05
|
||||
DEFAULT_WORK_INTERVAL = 0.05
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.calls = 0
|
||||
@@ -15,9 +18,9 @@ class DemoApp(ConfigManagerV2):
|
||||
def test_execute_loop_runs(tmp_path):
|
||||
async def scenario() -> None:
|
||||
cfg = tmp_path / "config.yaml"
|
||||
cfg.write_text("work_interval: 0.05\nupdate_interval: 0.05\n", encoding="utf-8")
|
||||
cfg.write_text("log: {}\n", encoding="utf-8")
|
||||
|
||||
app = DemoApp(str(cfg))
|
||||
app = DemoApp(str(cfg), management_settings=ManagementServerSettings(enabled=False))
|
||||
runner = asyncio.create_task(app.start())
|
||||
|
||||
await asyncio.sleep(0.18)
|
||||
|
||||
Reference in New Issue
Block a user