mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-14 19:29:36 +01:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user