.NET: Add timeout to TestTxDeadlockDetection
authorPavel Tupitsyn <ptupitsyn@apache.org>
Thu, 11 Jan 2018 14:16:57 +0000 (17:16 +0300)
committerPavel Tupitsyn <ptupitsyn@apache.org>
Thu, 11 Jan 2018 14:16:57 +0000 (17:16 +0300)
modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTransactionalTest.cs

index fac5614..7a60e9a 100644 (file)
@@ -529,7 +529,7 @@ namespace Apache.Ignite.Core.Tests.Cache
         /// <summary>
         /// Tests the transaction deadlock detection.
         /// </summary>
-        [Test, Timeout(50000)]
+        [Test]
         public void TestTxDeadlockDetection()
         {
             var cache = Cache();
@@ -556,8 +556,12 @@ namespace Apache.Ignite.Core.Tests.Cache
 
             // Increment keys within tx in different order to cause a deadlock.
             var aex = Assert.Throws<AggregateException>(() =>
-                Task.WaitAll(Task.Factory.StartNew(() => increment(keys0)),
-                             Task.Factory.StartNew(() => increment(keys0.Reverse().ToArray()))));
+                Task.WaitAll(new[]
+                    {
+                        Task.Factory.StartNew(() => increment(keys0)),
+                        Task.Factory.StartNew(() => increment(keys0.Reverse().ToArray()))
+                    },
+                    TimeSpan.FromSeconds(40)));
 
             Assert.AreEqual(2, aex.InnerExceptions.Count);