mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2025-01-12 06:38:01 +03:00
added more test timeouts
This commit is contained in:
parent
5991839c27
commit
650d221baf
@ -122,12 +122,17 @@ namespace Facepunch.Steamworks.Test
|
|||||||
|
|
||||||
client.Inventory.Refresh();
|
client.Inventory.Refresh();
|
||||||
|
|
||||||
|
var stopwatch = Stopwatch.StartNew();
|
||||||
|
|
||||||
//
|
//
|
||||||
// Block until we have the items
|
// Block until we have the items
|
||||||
//
|
//
|
||||||
while ( client.Inventory.SerializedItems == null )
|
while ( client.Inventory.SerializedItems == null )
|
||||||
{
|
{
|
||||||
client.Update();
|
client.Update();
|
||||||
|
|
||||||
|
if (stopwatch.Elapsed.Seconds > 10)
|
||||||
|
throw new System.Exception("Getting SerializedItems took too long");
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.IsNotNull( client.Inventory.SerializedItems );
|
Assert.IsNotNull( client.Inventory.SerializedItems );
|
||||||
@ -140,7 +145,15 @@ namespace Facepunch.Steamworks.Test
|
|||||||
|
|
||||||
var result = server.Inventory.Deserialize( client.Inventory.SerializedItems );
|
var result = server.Inventory.Deserialize( client.Inventory.SerializedItems );
|
||||||
|
|
||||||
server.UpdateWhile( () => result.IsPending );
|
stopwatch = Stopwatch.StartNew();
|
||||||
|
|
||||||
|
while (result.IsPending)
|
||||||
|
{
|
||||||
|
server.Update();
|
||||||
|
|
||||||
|
if (stopwatch.Elapsed.Seconds > 10)
|
||||||
|
throw new System.Exception("result took too long");
|
||||||
|
}
|
||||||
|
|
||||||
Assert.IsFalse( result.IsPending );
|
Assert.IsFalse( result.IsPending );
|
||||||
Assert.IsNotNull( result.Items );
|
Assert.IsNotNull( result.Items );
|
||||||
|
@ -73,10 +73,16 @@ namespace Facepunch.Steamworks.Test
|
|||||||
{
|
{
|
||||||
var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric );
|
var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric );
|
||||||
|
|
||||||
|
var time = Stopwatch.StartNew();
|
||||||
while ( !board.IsValid )
|
while ( !board.IsValid )
|
||||||
{
|
{
|
||||||
Thread.Sleep( 10 );
|
Thread.Sleep( 10 );
|
||||||
client.Update();
|
client.Update();
|
||||||
|
|
||||||
|
if (time.Elapsed.TotalSeconds > 10)
|
||||||
|
{
|
||||||
|
throw new Exception("board.IsValid took too long");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.IsTrue( board.IsValid );
|
Assert.IsTrue( board.IsValid );
|
||||||
@ -115,10 +121,16 @@ namespace Facepunch.Steamworks.Test
|
|||||||
{
|
{
|
||||||
var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric );
|
var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric );
|
||||||
|
|
||||||
while ( !board.IsValid )
|
var time = Stopwatch.StartNew();
|
||||||
|
while (!board.IsValid)
|
||||||
{
|
{
|
||||||
Thread.Sleep( 10 );
|
Thread.Sleep(10);
|
||||||
client.Update();
|
client.Update();
|
||||||
|
|
||||||
|
if (time.Elapsed.TotalSeconds > 10)
|
||||||
|
{
|
||||||
|
throw new Exception("board.IsValid took too long");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.IsTrue( board.IsValid );
|
Assert.IsTrue( board.IsValid );
|
||||||
@ -153,10 +165,16 @@ namespace Facepunch.Steamworks.Test
|
|||||||
{
|
{
|
||||||
var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric );
|
var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric );
|
||||||
|
|
||||||
while ( !board.IsValid )
|
var time = Stopwatch.StartNew();
|
||||||
|
while (!board.IsValid)
|
||||||
{
|
{
|
||||||
Thread.Sleep( 10 );
|
Thread.Sleep(10);
|
||||||
client.Update();
|
client.Update();
|
||||||
|
|
||||||
|
if (time.Elapsed.TotalSeconds > 10)
|
||||||
|
{
|
||||||
|
throw new Exception("board.IsValid took too long");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.IsTrue( board.IsValid );
|
Assert.IsTrue( board.IsValid );
|
||||||
@ -189,10 +207,16 @@ namespace Facepunch.Steamworks.Test
|
|||||||
{
|
{
|
||||||
var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric );
|
var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric );
|
||||||
|
|
||||||
while ( !board.IsValid )
|
var time = Stopwatch.StartNew();
|
||||||
|
while (!board.IsValid)
|
||||||
{
|
{
|
||||||
Thread.Sleep( 10 );
|
Thread.Sleep(10);
|
||||||
client.Update();
|
client.Update();
|
||||||
|
|
||||||
|
if (time.Elapsed.TotalSeconds > 10)
|
||||||
|
{
|
||||||
|
throw new Exception("board.IsValid took too long");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.IsTrue( board.IsValid );
|
Assert.IsTrue( board.IsValid );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user