Pooled integration instances now get marked non-idle

Otherwise, pooled integration instances could behave differently from freshly-spawned ones, creating heisentests.
This commit is contained in:
PJB3005
2025-07-10 16:26:56 +02:00
parent 2349728eab
commit 3634ee636b
2 changed files with 14 additions and 1 deletions

View File

@@ -43,7 +43,7 @@ END TEMPLATE-->
### Bugfixes
*None yet*
* Pooled integration instances returned by `RobustIntegrationTest` are now treated as non-idle, for consistency with non-pooled startups.
### Other

View File

@@ -94,6 +94,10 @@ namespace Robust.UnitTesting
OnServerReturn(server).Wait();
// Ensure the instance is properly idle to avoid inconsistencies in behavior
// between pooled and non-pooled returns.
server.MarkNonIdle();
_serversRunning[server] = 0;
instance = server;
}
@@ -139,6 +143,10 @@ namespace Robust.UnitTesting
OnClientReturn(client).Wait();
// Ensure the instance is properly idle to avoid inconsistencies in behavior
// between pooled and non-pooled returns.
client.MarkNonIdle();
_clientsRunning[client] = 0;
instance = client;
}
@@ -602,6 +610,11 @@ namespace Robust.UnitTesting
await WaitIdleAsync();
}
internal void MarkNonIdle()
{
Post(() => {});
}
public virtual Task Cleanup() => Task.CompletedTask;
public void Dispose()