mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +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:
@@ -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