diff --git a/doc/user/content/release_notes/_index.md b/doc/user/content/release_notes/_index.md index e7be97cc7..f7fb3889d 100644 --- a/doc/user/content/release_notes/_index.md +++ b/doc/user/content/release_notes/_index.md @@ -13,19 +13,19 @@ insert_anchor_links = "right" - Simpler representation of complex algo chains in order book and mini order book - Visual and usability improvements to mini order book - Streamlining of algo parameter dialog in ladder - - New spreader queue holder behaviour + - New spreader queue holder behavior - Visual improvements to the order book - New server side API - Improved admin UI performance - Optimized PIQ rendering ### Internal changes - Exchange simulator no longer requires daily sequence number reset - - Improved MD resiliance to corrupted shared memory - - Native orders can now buffer updates/cancels when disconected or pending first acknowledgment + - Improved MD resilience to corrupted shared memory + - Native orders can now buffer updates/cancels when disconnected or pending first acknowledgment - Improved settings manager tool output - Added diagnostics in the event MD memory corruption is detected - Added systems tests for join,lean, iceberg and spreader orders - - Made exchange order recovery more resiliant in the presence of database loss + - Made exchange order recovery more resilient in the presence of database loss ## 1.6.2 ### User Visible Changes diff --git a/src/client/spark_test/System/JoinAlgoTests.cs b/src/client/spark_test/System/JoinAlgoTests.cs index 859904888..a98c4f1bb 100644 --- a/src/client/spark_test/System/JoinAlgoTests.cs +++ b/src/client/spark_test/System/JoinAlgoTests.cs @@ -12,6 +12,14 @@ using System.Threading.Tasks; namespace bts.tests { + /// + /// For buy orders: + /// triggers when: curr_bid.price > initial_bid && current_bid.qty >= join_threshold. + /// i.e. When the join is first entered, it looks at the market to capture the initial bid and + /// then it waits until the current bid is above that level AND that the qty at that level is greater + /// that some threshold. + /// + [TestGroup(TestType = TestType.System)] public class JoinAlgoTests : TestBase { public JoinAlgoTests() { } @@ -91,6 +99,7 @@ namespace bts.tests { public async Task test_join_qty_threshold() { double initial_price = 54.99; double ask_price = 55.01; + uint ask_size = 1; uint qty_threshold = 15; @@ -103,7 +112,7 @@ namespace bts.tests { var bid_order_def = OrderDefinitionUtilities.create_limit_order_def(s.Value.Id, Side.Buy, _test_account, _test_user); var ask_order_def = OrderDefinitionUtilities.create_limit_order_def(s.Value.Id, Side.Sell, _test_account, _test_user); orders_response_list.Add(await OrderUtilities.send_order(_order_service, bid_order_def, 55.00, 10)); - orders_response_list.Add(await OrderUtilities.send_order(_order_service, ask_order_def, ask_price, 1)); + orders_response_list.Add(await OrderUtilities.send_order(_order_service, ask_order_def, ask_price, ask_size)); List test_orders = new List(); foreach (var i in orders_response_list) { var iret = (await OrderUtilities.wait_for_filtered_orders( @@ -155,12 +164,15 @@ namespace bts.tests { Assert.IsTrue(join_child_order.Count() == 1, $"The join child order should still have been 'working' at {initial_price}"); // now we modify our top bid's volume to meet the join's threshold - bid_order_response = await OrderUtilities.modify_order(_order_service, modified_bid_order.First(), qty_threshold); + // note that we must add the intial ask_size to the qty_threshold b/c we have partially filled our bid order + // when we moved the bid up. + var target_qty = qty_threshold + ask_size; + bid_order_response = await OrderUtilities.modify_order(_order_service, modified_bid_order.First(), target_qty); modified_bid_order = (await OrderUtilities.wait_for_filtered_orders( _order_service, - rows => rows.Where(o => o.Key == bid_order_response.value.OrderKey && o.HasState && o.State.Quantity == qty_threshold).Count() == 1, + rows => rows.Where(o => o.Key == bid_order_response.value.OrderKey && o.HasState && o.State.Quantity == target_qty).Count() == 1, rows => rows.Where(o => o.Key == bid_order_response.value.OrderKey))).result ?? Enumerable.Empty(); - Assert.IsTrue(modified_bid_order.Count() == 1, $"The working bid should have its quantity modified to {qty_threshold}"); + Assert.IsTrue(modified_bid_order.Count() == 1, $"The working bid should have its quantity modified to {target_qty}"); // now that the qty threshold has been met, verify that the child order has joined the market at the appropriate price join_child_order = (await OrderUtilities.wait_for_filtered_orders( diff --git a/src/client/spark_test/system_test_scripts/spreader_simple_sanity.sh b/src/client/spark_test/system_test_scripts/spreader_simple_sanity.sh index 622c012e4..cd45f475f 100644 --- a/src/client/spark_test/system_test_scripts/spreader_simple_sanity.sh +++ b/src/client/spark_test/system_test_scripts/spreader_simple_sanity.sh @@ -42,9 +42,13 @@ echo "sleeping for 120 seconds..." sleep 120 dotnet sparkcmd.dll test spreader_simple_sanity +exit_status=$? pkill -P $$ if [ -f "$bak" ];then mv $bak $conf -fi \ No newline at end of file +fi + +[ $exit_status -eq 0 ] && echo "Test Finished" || echo "Test failed" +exit $exit_status \ No newline at end of file diff --git a/src/client/spark_test/system_test_scripts/test_clip_limits.sh b/src/client/spark_test/system_test_scripts/test_clip_limits.sh index fa6501da3..b0511eb14 100644 --- a/src/client/spark_test/system_test_scripts/test_clip_limits.sh +++ b/src/client/spark_test/system_test_scripts/test_clip_limits.sh @@ -42,9 +42,13 @@ echo "sleeping for 120 seconds..." sleep 120 dotnet sparkcmd.dll test test_clip_limits +exit_status=$? pkill -P $$ if [ -f "$bak" ];then mv $bak $conf -fi \ No newline at end of file +fi + +[ $exit_status -eq 0 ] && echo "Test Finished" || echo "Test failed" +exit $exit_status \ No newline at end of file diff --git a/src/client/spark_test/system_test_scripts/test_join_algo.sh b/src/client/spark_test/system_test_scripts/test_join_algo.sh index 9e154eb72..616dcadba 100644 --- a/src/client/spark_test/system_test_scripts/test_join_algo.sh +++ b/src/client/spark_test/system_test_scripts/test_join_algo.sh @@ -5,6 +5,13 @@ # Stop script if unbound variable found (use ${var:-} if intentional) set -u +if [ -d ~/sparkdata/ ] +then + sparkdata_dir=~/sparkdata +else + sparkdata_dir=/sparkdata +fi + # Use in the the functions: eval $invocation invocation='say_verbose "Calling: ${yellow:-}${FUNCNAME[0]} ${green:-}$*${normal:-}"' @@ -110,6 +117,7 @@ run_bts_test() { for test_name in ${test_names_tuple[@]}; do say_verbose "running test with name: $test_name ..."; dotnet sparkcmd.dll test $test_name + exit_status=$? done return 0 @@ -117,7 +125,7 @@ run_bts_test() { test_script_name=$(basename "$0") verbose=true -config_file_path="/home/bts/sparkdata/conf/test_join_algo_tests.conf" +config_file_path="$sparkdata_dir/conf/test_join_algo_tests.conf" test_config_file_created=false merge_with_md_key=$(/bin/cat <<'END_HEREDOC' ExchangeSim { @@ -148,4 +156,5 @@ fi # Kill sparkd pkill -P $$ -say "Test has finished." +[ $exit_status -eq 0 ] && echo "Test Finished" || echo "Test failed" +exit $exit_status diff --git a/src/client/spark_test/system_test_scripts/test_position_limits.sh b/src/client/spark_test/system_test_scripts/test_position_limits.sh index 045eece76..4e3070c41 100644 --- a/src/client/spark_test/system_test_scripts/test_position_limits.sh +++ b/src/client/spark_test/system_test_scripts/test_position_limits.sh @@ -41,9 +41,13 @@ echo "sparkd pid: " $pid echo "sleeping for 120 seconds..." sleep 120 dotnet sparkcmd.dll test test_position_limits +exit_status=$? pkill -P $$ if [ -f "$bak" ];then mv $bak $conf -fi \ No newline at end of file +fi + +[ $exit_status -eq 0 ] && echo "Test Finished" || echo "Test failed" +exit $exit_status \ No newline at end of file