fix(deploy): 优化大表迁移并修复后台事件循环
This commit is contained in:
@@ -1464,6 +1464,20 @@ class TestBindingAndCompletion(_Base):
|
||||
self.session.refresh(task)
|
||||
assert task.bind_task_id == bind_tasks[0].id
|
||||
|
||||
def test_customer_started_binding_does_not_capture_request_loop(self, monkeypatch):
|
||||
task = self._allocated()
|
||||
captured: dict[str, object] = {}
|
||||
monkeypatch.setattr(
|
||||
service,
|
||||
"start_douyu_batch",
|
||||
lambda **kwargs: captured.update(kwargs),
|
||||
)
|
||||
|
||||
asyncio.run(service.customer_start_binding(self.session, task_id=task.id))
|
||||
|
||||
assert captured["capture_event_loop"] is False
|
||||
assert "loop" not in captured
|
||||
|
||||
def test_concurrent_start_binding_creates_one_task(self, monkeypatch):
|
||||
task = self._allocated()
|
||||
monkeypatch.setattr(service, "start_douyu_batch", lambda **_kwargs: None)
|
||||
|
||||
Reference in New Issue
Block a user