Skip to content

Commit b42f324

Browse files
committed
Clear the error builder
1 parent 68c3f6c commit b42f324

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

com.unity.netcode.gameobjects/TestHelpers/Runtime/NetcodeIntegrationTest.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,12 @@ protected IEnumerator WaitForConditionOrAssert(Func<bool> checkForCondition, str
16931693
protected IEnumerator WaitForConditionOrAssert(Func<StringBuilder, bool> checkForCondition, string timeoutErrorMessage, TimeoutHelper timeOutHelper = null)
16941694
{
16951695
var errorBuilder = new StringBuilder();
1696-
yield return WaitForConditionOrTimeOut(() => checkForCondition(errorBuilder), timeOutHelper);
1696+
yield return WaitForConditionOrTimeOut(() =>
1697+
{
1698+
// Clear errorBuilder before each check to ensure the errorBuilder only contains information from the lastest run
1699+
errorBuilder.Clear();
1700+
return checkForCondition(errorBuilder);
1701+
}, timeOutHelper);
16971702
AssertOnTimeout($"{timeoutErrorMessage}\n{errorBuilder}", timeOutHelper);
16981703
}
16991704

0 commit comments

Comments
 (0)