fix(execution): fail closed on unresolved orders
This commit is contained in:
@@ -143,7 +143,9 @@ def test_poll_fill_uses_current_all_market_contract(monkeypatch):
|
||||
|
||||
monkeypatch.setattr("trex_core.adapters.broker.kis.httpx.get", fake_get)
|
||||
|
||||
status = broker.poll_fill("91258:1234", side="buy", symbol="005930")
|
||||
status = broker.poll_fill(
|
||||
"91258:1234", side="buy", symbol="005930", order_date="20260608"
|
||||
)
|
||||
|
||||
assert status.state == "accepted"
|
||||
assert seen["tr_id"] == "VTTC0081R"
|
||||
@@ -578,8 +580,12 @@ def test_fill_poll_transport_failure_uses_backoff(monkeypatch):
|
||||
|
||||
monkeypatch.setattr("trex_core.adapters.broker.kis.httpx.get", fail)
|
||||
|
||||
first = b.poll_fill("91258:1234", side="buy", symbol="005930")
|
||||
immediate = b.poll_fill("91258:1234", side="buy", symbol="005930")
|
||||
first = b.poll_fill(
|
||||
"91258:1234", side="buy", symbol="005930", order_date="20260608"
|
||||
)
|
||||
immediate = b.poll_fill(
|
||||
"91258:1234", side="buy", symbol="005930", order_date="20260608"
|
||||
)
|
||||
|
||||
assert first.state == "unknown"
|
||||
assert immediate.state == "accepted"
|
||||
@@ -587,6 +593,8 @@ def test_fill_poll_transport_failure_uses_backoff(monkeypatch):
|
||||
assert len(calls) == 1
|
||||
|
||||
clock[0] += 31
|
||||
again = b.poll_fill("91258:1234", side="buy", symbol="005930")
|
||||
again = b.poll_fill(
|
||||
"91258:1234", side="buy", symbol="005930", order_date="20260608"
|
||||
)
|
||||
assert again.state == "unknown"
|
||||
assert len(calls) == 2
|
||||
|
||||
Reference in New Issue
Block a user