Skip to content

Commit 15b0f5d

Browse files
committed
Prove Python shutdown child test completion
1 parent e7a28aa commit 15b0f5d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Tests/Common/Python/PythonInitializerTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ namespace QuantConnect.Tests.Common.Python
2929
public class PythonInitializerTests
3030
{
3131
private const string ShutdownChildProcess = "LEAN_PYTHON_SHUTDOWN_CHILD_PROCESS";
32+
private const string ShutdownChildProcessCompleted = "LEAN_PYTHON_SHUTDOWN_COMPLETED";
3233

3334
[Test]
3435
public void AlgorithmLocationIsAlwaysBeforeOtherPaths()
@@ -67,6 +68,7 @@ public void ShutdownCompletesWithoutLeakingGil()
6768

6869
GC.Collect();
6970
GC.WaitForPendingFinalizers();
71+
TestContext.Progress.WriteLine(ShutdownChildProcessCompleted);
7072
return;
7173
}
7274

@@ -97,6 +99,7 @@ public void ShutdownCompletesWithoutLeakingGil()
9799

98100
var output = standardOutput.GetAwaiter().GetResult() + standardError.GetAwaiter().GetResult();
99101
Assert.AreEqual(0, process.ExitCode, output);
102+
StringAssert.Contains(ShutdownChildProcessCompleted, output);
100103
StringAssert.DoesNotContain("GIL must always be released", output);
101104
StringAssert.DoesNotContain("Py.GILState.Finalize", output);
102105
}

0 commit comments

Comments
 (0)