Skip to content

Commit

Permalink
Separate process per test for TS2K Windows tests (#706)
Browse files Browse the repository at this point in the history
This is workaround memory issues on CI builds for Windows on GitHub Actions
  • Loading branch information
cgravill authored Apr 8, 2021
1 parent bdb263a commit 921a905
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
16 changes: 16 additions & 0 deletions test/builds/multiprocess_ts2k_tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# The tests run out of memory on CI see https://github.com/microsoft/knossos-ksc/issues/679 for details of the leak in module creation
# pytest-forked on Windows doesn't help, so: collect the tests, run one at a time, exit on any failure
$alltests = pytest $PSScriptRoot\..\ts2k\ --collect-only --quiet --disable-pytest-warnings | Select-Object -skip 2 -last 1000000

$alltests

Foreach ($test in $alltests)
{
$test
$test_output = pytest $test
if ( 0 -ne $LastExitcode)
{
Write-Output $test_output
exit $LastExitcode
}
}
5 changes: 4 additions & 1 deletion test/builds/test_pytest_PyTorchPreview.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ python -m pip install --editable . || exit /b
cd ../..

REM we only run a single test for now, multiple tests run out of heap see #679
pytest test\ts2k\test_ts2k.py -k test_cat
REM pytest test\ts2k\test_ts2k.py -k test_cat

REM echo Running pytest on ts2k
REM pytest test/ts2k || exit /b

REM this runs the tests one by one avoiding the memory issues
powershell.exe -file "%~dp0multiprocess_ts2k_tests.ps1" || exit /b

0 comments on commit 921a905

Please sign in to comment.