From 1730fd20bcbd07c97d4628a9e4bec0662ff03bd6 Mon Sep 17 00:00:00 2001 From: Michael Harding Date: Thu, 7 Feb 2019 12:37:10 -0500 Subject: [PATCH] Fix clip limits test --- src/client/spark_test/System/LimitsTests.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/client/spark_test/System/LimitsTests.cs b/src/client/spark_test/System/LimitsTests.cs index b517765bd..36a2235fe 100644 --- a/src/client/spark_test/System/LimitsTests.cs +++ b/src/client/spark_test/System/LimitsTests.cs @@ -124,10 +124,16 @@ namespace bts.tests over_limit_order_key = over_limit_order_result.value.OrderKey; no_limit_order_key = no_limit_order_result.value.OrderKey; + bool waiting_for_orders = true; + var orders = _order_service.subscribei_orders().Subscribe(ords => { + waiting_for_orders = false; + IEnumerable filtered_orders = ords.all.Where(x => x.Key == under_limit_order_key || x.Key == over_limit_order_key || x.Key == no_limit_order_key); + Assert.IsTrue(filtered_orders.Count() == 3, "There should be 3 matching orders... there are not"); + foreach(var o in filtered_orders) { if(o.Key == under_limit_order_key) { @@ -142,6 +148,9 @@ namespace bts.tests } }); + while(waiting_for_orders) { + await Task.Delay(100); + } // Restore the Limits to the original values bool success = false;