Skip to content

Commit

Permalink
Merge pull request #1329 from bug-or-feature/fix_slow_test
Browse files Browse the repository at this point in the history
Attempt to fix slow tests in the master branch
  • Loading branch information
robcarver17 authored Feb 8, 2024
2 parents bcfd966 + 1c645f7 commit fe7d796
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/slow-test-develop.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
name: Slow test
name: Slow test (develop)

on:
schedule:
- cron: '0 1 * * *'
- cron: '0 2 * * *'

workflow_dispatch:

jobs:
build:

runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [ 3.8, 3.7 ]
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: "develop"

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: '3.10'

- name: Install dependencies
run: |
Expand Down
15 changes: 6 additions & 9 deletions .github/workflows/slow-test-master.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
name: Slow test
name: Slow test (master)

on:
schedule:
- cron: '30 1 * * 0'
- cron: '0 1 * * 0'

workflow_dispatch:

jobs:
build:

runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [ 3.8, 3.7 ]
runs-on: ubuntu-latest

steps:

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: "master"

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: '3.8'

- name: Install dependencies
run: |
Expand Down
11 changes: 7 additions & 4 deletions sysexecution/stack_handler/roll_orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,14 +472,17 @@ def get_strategy_name_with_largest_position_for_instrument(
)

try:
strategy_name = all_instrument_positions.strategy_name_with_largest_abs_position_for_instrument(
instrument_code
)
strategy_name = all_instrument_positions.strategy_name_with_largest_abs_position_for_instrument(
instrument_code
)
except:
## corner case where nets out to 0
strategies = diag_positions.get_list_of_strategies_with_positions()
strategy_name = strategies[0]
data.log.debug("No strategies have net positions in %s, using arbitrary strategy %s" % (instrument_code, strategy_name))
data.log.debug(
"No strategies have net positions in %s, using arbitrary strategy %s"
% (instrument_code, strategy_name)
)

return strategy_name

Expand Down

0 comments on commit fe7d796

Please sign in to comment.