Skip to content

Add live paper and processing pool tests for contingent orders - #9833

Merged
Martin-Molinero merged 2 commits into
masterfrom
contingent-orders-live-tests
Sep 25, 2026
Merged

Martin-Molinero merged 2 commits into
masterfrom
contingent-orders-live-tests

Conversation

@Martin-Molinero

@Martin-Molinero Martin-Molinero commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Follow up of #9828: unit tests for the live paper trading path of contingent orders, which the existing tests cover in backtesting mode only, and a sturdier brokerage trigger test.

Test Covers
BacktestingTransactionHandlerTests.ProcessesContingentOrdersInLivePaperTrading a bracket through the paper brokerage in live mode with concurrency on: placed by the transaction threads once the set arrived, children held, triggered by the entry fill, take profit fills and cancels the stop loss
OrderRequestProcessingPoolTests.ContingentOrdersAreProcessedInArrivalOrderWithoutBlockingOtherOrders the orders of a set are processed one at a time in arrival order, an unrelated order doesn't wait for them, set ids don't collide with order ids
BrokerageTests.ContingentOrdersTrigger now cancels the triggered orders and waits for them to be canceled (30s timeout) before the tear down closes the position: Alpaca rejected that close while the take profit still reserved the shares

The two new unit tests run in under 100 ms.

🤖 Generated with Claude Code

Martin-Molinero and others added 2 commits September 25, 2026 10:48
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…er brokerage test

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Martin-Molinero
Martin-Molinero merged commit e02972a into master Sep 25, 2026
11 of 16 checks passed
@Martin-Molinero
Martin-Molinero deleted the contingent-orders-live-tests branch September 25, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant