Skip to content

Commit e9f5a31

Browse files
CopilotQilongTang
andcommitted
Fix sporadic failure in ResetCypythonLogsToConsoleAfterRun test
Co-authored-by: QilongTang <3942418+QilongTang@users.noreply.github.com>
1 parent e296b0d commit e9f5a31

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/Libraries/DynamoPythonTests/PythonTestsWithLogging.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ public void ResetCypythonLogsToConsoleAfterRun()
176176

177177
RunCurrentModel();
178178
CurrentDynamoModel.OnRequestPythonReset(PythonEngineManager.PythonNet3EngineName);
179+
180+
// Wait for all scheduler tasks to complete to ensure Python reset logging is finished
181+
while (CurrentDynamoModel.Scheduler.ProcessNextTask(false))
182+
{
183+
}
184+
179185
foreach(var line in expectedOutput.Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
180186
{
181187
StringAssert.Contains(line, CurrentDynamoModel.Logger.LogText);

0 commit comments

Comments
 (0)