From d9fca6da55a46e39bdb7ad2c0dba0b7205a7e70b Mon Sep 17 00:00:00 2001 From: Sergey Yelin Date: Fri, 21 May 2021 13:28:56 +0300 Subject: [PATCH] Prepare for Erlang 24 (#150) * Update deps with support for Erlang 24 * Remove generated artefacts from test * Fix compiler warning * Format --- Makefile | 6 +- rebar.config | 8 +- rebar.lock | 36 +-- src/woody_cert.erl | 4 +- src/woody_client_thrift_http_transport.erl | 6 +- src/woody_event_formatter.erl | 135 ++++++----- src/woody_event_handler.erl | 252 +++++++++++---------- src/woody_server_thrift_handler.erl | 6 +- test/meter_memory_pressure.erl | 4 +- test/server_timeout_event_handler.erl | 8 +- test/woody_tests_SUITE.erl | 15 +- 11 files changed, 248 insertions(+), 232 deletions(-) diff --git a/Makefile b/Makefile index c8d0929..4c591d6 100644 --- a/Makefile +++ b/Makefile @@ -51,10 +51,8 @@ clean: $(REBAR) as prod clean distclean: - $(REBAR) clean -a - $(REBAR) as test clean -a - $(REBAR) as prod clean -a - rm -rfv _build _builds _cache _steps _temp + rm -rf test/woody_test_thrift.?rl test/.rebar3 + rm -rfv _build dialyze: $(REBAR) as test dialyzer diff --git a/rebar.config b/rebar.config index 3ada48a..29d1132 100644 --- a/rebar.config +++ b/rebar.config @@ -20,9 +20,9 @@ % Common project dependencies. {deps, [ - {cowboy, "2.7.0"}, - {hackney, "1.17.0"}, - {gproc , "0.8.0"}, + {cowboy, "2.9.0"}, + {hackney, "1.17.4"}, + {gproc , "0.9.0"}, {cache , "2.3.3"}, {thrift, {git, "https://github.com/rbkmoney/thrift_erlang.git", {branch, "master"}}}, {snowflake, {git, "https://github.com/rbkmoney/snowflake.git", {branch, "master"}}}, @@ -82,7 +82,7 @@ {plugins, [ {rebar3_thrift_compiler, {git, "https://github.com/rbkmoney/rebar3_thrift_compiler.git", {branch, "master"}}}, - {erlfmt, "0.9.0"} + {erlfmt, "0.14.1"} ]}. {erlfmt, [ diff --git a/rebar.lock b/rebar.lock index 0fa4971..c5f988c 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,13 +1,13 @@ {"1.2.0", [{<<"bear">>,{pkg,<<"bear">>,<<"0.8.7">>},2}, {<<"cache">>,{pkg,<<"cache">>,<<"2.3.3">>},0}, - {<<"certifi">>,{pkg,<<"certifi">>,<<"2.5.3">>},1}, + {<<"certifi">>,{pkg,<<"certifi">>,<<"2.6.1">>},1}, {<<"cg_mon">>, {git,"https://github.com/rbkmoney/cg_mon.git", {ref,"5a87a37694e42b6592d3b4164ae54e0e87e24e18"}}, 1}, - {<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.7.0">>},0}, - {<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.8.0">>},1}, + {<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.9.0">>},0}, + {<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.11.0">>},1}, {<<"folsom">>, {git,"https://github.com/folsom-project/folsom.git", {ref,"9309bad9ffadeebbefe97521577c7480c7cfcd8a"}}, @@ -16,8 +16,8 @@ {git,"https://github.com/rbkmoney/genlib.git", {ref,"4565a8d73f34a0b78cca32c9cd2b97d298bdadf8"}}, 0}, - {<<"gproc">>,{pkg,<<"gproc">>,<<"0.8.0">>},0}, - {<<"hackney">>,{pkg,<<"hackney">>,<<"1.17.0">>},0}, + {<<"gproc">>,{pkg,<<"gproc">>,<<"0.9.0">>},0}, + {<<"hackney">>,{pkg,<<"hackney">>,<<"1.17.4">>},0}, {<<"how_are_you">>, {git,"https://github.com/rbkmoney/how_are_you.git", {ref,"8f11d17eeb6eb74096da7363a9df272fd3099718"}}, @@ -26,7 +26,7 @@ {<<"metrics">>,{pkg,<<"metrics">>,<<"1.0.1">>},1}, {<<"mimerl">>,{pkg,<<"mimerl">>,<<"1.2.0">>},1}, {<<"parse_trans">>,{pkg,<<"parse_trans">>,<<"3.3.1">>},1}, - {<<"ranch">>,{pkg,<<"ranch">>,<<"1.7.1">>},1}, + {<<"ranch">>,{pkg,<<"ranch">>,<<"1.8.0">>},1}, {<<"snowflake">>, {git,"https://github.com/rbkmoney/snowflake.git", {ref,"de159486ef40cec67074afe71882bdc7f7deab72"}}, @@ -41,31 +41,31 @@ {pkg_hash,[ {<<"bear">>, <<"16264309AE5D005D03718A5C82641FCC259C9E8F09ADEB6FD79CA4271168656F">>}, {<<"cache">>, <<"B23A5FE7095445A88412A6E614C933377E0137B44FFED77C9B3FEF1A731A20B2">>}, - {<<"certifi">>, <<"70BDD7E7188C804F3A30EE0E7C99655BC35D8AC41C23E12325F36AB449B70651">>}, - {<<"cowboy">>, <<"91ED100138A764355F43316B1D23D7FF6BDB0DE4EA618CB5D8677C93A7A2F115">>}, - {<<"cowlib">>, <<"FD0FF1787DB84AC415B8211573E9A30A3EBE71B5CBFF7F720089972B2319C8A4">>}, - {<<"gproc">>, <<"CEA02C578589C61E5341FCE149EA36CCEF236CC2ECAC8691FBA408E7EA77EC2F">>}, - {<<"hackney">>, <<"717EA195FD2F898D9FE9F1CE0AFCC2621A41ECFE137FAE57E7FE6E9484B9AA99">>}, + {<<"certifi">>, <<"DBAB8E5E155A0763EEA978C913CA280A6B544BFA115633FA20249C3D396D9493">>}, + {<<"cowboy">>, <<"865DD8B6607E14CF03282E10E934023A1BD8BE6F6BACF921A7E2A96D800CD452">>}, + {<<"cowlib">>, <<"0B9FF9C346629256C42EBE1EEB769A83C6CB771A6EE5960BD110AB0B9B872063">>}, + {<<"gproc">>, <<"853CCB7805E9ADA25D227A157BA966F7B34508F386A3E7E21992B1B484230699">>}, + {<<"hackney">>, <<"99DA4674592504D3FB0CFEF0DB84C3BA02B4508BAE2DFF8C0108BAA0D6E0977C">>}, {<<"idna">>, <<"8A63070E9F7D0C62EB9D9FCB360A7DE382448200FBBD1B106CC96D3D8099DF8D">>}, {<<"metrics">>, <<"25F094DEA2CDA98213CECC3AEFF09E940299D950904393B2A29D191C346A8486">>}, {<<"mimerl">>, <<"67E2D3F571088D5CFD3E550C383094B47159F3EEE8FFA08E64106CDF5E981BE3">>}, {<<"parse_trans">>, <<"16328AB840CC09919BD10DAB29E431DA3AF9E9E7E7E6F0089DD5A2D2820011D8">>}, - {<<"ranch">>, <<"6B1FAB51B49196860B733A49C07604465A47BDB78AA10C1C16A3D199F7F8C881">>}, + {<<"ranch">>, <<"8C7A100A139FD57F17327B6413E4167AC559FBC04CA7448E9BE9057311597A1D">>}, {<<"ssl_verify_fun">>, <<"CF344F5692C82D2CD7554F5EC8FD961548D4FD09E7D22F5B62482E5AEAEBD4B0">>}, {<<"unicode_util_compat">>, <<"BC84380C9AB48177092F43AC89E4DFA2C6D62B40B8BD132B1059ECC7232F9A78">>}]}, {pkg_hash_ext,[ {<<"bear">>, <<"534217DCE6A719D59E54FB0EB7A367900DBFC5F85757E8C1F94269DF383F6D9B">>}, {<<"cache">>, <<"44516CE6FA03594D3A2AF025DD3A87BFE711000EB730219E1DDEFC816E0AA2F4">>}, - {<<"certifi">>, <<"ED516ACB3929B101208A9D700062D520F3953DA3B6B918D866106FFA980E1C10">>}, - {<<"cowboy">>, <<"04FD8C6A39EDC6AAA9C26123009200FC61F92A3A94F3178C527B70B767C6E605">>}, - {<<"cowlib">>, <<"79F954A7021B302186A950A32869DBC185523D99D3E44CE430CD1F3289F41ED4">>}, - {<<"gproc">>, <<"580ADAFA56463B75263EF5A5DF4C86AF321F68694E7786CB057FD805D1E2A7DE">>}, - {<<"hackney">>, <<"64C22225F1EA8855F584720C0E5B3CD14095703AF1C9FBC845BA042811DC671C">>}, + {<<"certifi">>, <<"524C97B4991B3849DD5C17A631223896272C6B0AF446778BA4675A1DFF53BB7E">>}, + {<<"cowboy">>, <<"2C729F934B4E1AA149AFF882F57C6372C15399A20D54F65C8D67BEF583021BDE">>}, + {<<"cowlib">>, <<"2B3E9DA0B21C4565751A6D4901C20D1B4CC25CBB7FD50D91D2AB6DD287BC86A9">>}, + {<<"gproc">>, <<"587E8AF698CCD3504CF4BA8D90F893EDE2B0F58CABB8A916E2BF9321DE3CF10B">>}, + {<<"hackney">>, <<"DE16FF4996556C8548D512F4DBE22DD58A587BF3332E7FD362430A7EF3986B16">>}, {<<"idna">>, <<"92376EB7894412ED19AC475E4A86F7B413C1B9FBB5BD16DCCD57934157944CEA">>}, {<<"metrics">>, <<"69B09ADDDC4F74A40716AE54D140F93BEB0FB8978D8636EADED0C31B6F099F16">>}, {<<"mimerl">>, <<"F278585650AA581986264638EBF698F8BB19DF297F66AD91B18910DFC6E19323">>}, {<<"parse_trans">>, <<"07CD9577885F56362D414E8C4C4E6BDF10D43A8767ABB92D24CBE8B24C54888B">>}, - {<<"ranch">>, <<"451D8527787DF716D99DC36162FCA05934915DB0B6141BBDAC2EA8D3C7AFC7D7">>}, + {<<"ranch">>, <<"49FBCFD3682FAB1F5D109351B61257676DA1A2FDBE295904176D5E521A2DDFE5">>}, {<<"ssl_verify_fun">>, <<"BDB0D2471F453C88FF3908E7686F86F9BE327D065CC1EC16FA4540197EA04680">>}, {<<"unicode_util_compat">>, <<"25EEE6D67DF61960CF6A794239566599B09E17E668D3700247BC498638152521">>}]} ]. diff --git a/src/woody_cert.erl b/src/woody_cert.erl index 498d7d6..f7368c3 100644 --- a/src/woody_cert.erl +++ b/src/woody_cert.erl @@ -35,8 +35,8 @@ get_common_name(#'OTPCertificate'{tbsCertificate = TbsCert}) -> get_cn_from_rdn({rdnSequence, RDNSeq}) -> [ to_binary(V) - || ATVs <- RDNSeq, - #'AttributeTypeAndValue'{type = ?'id-at-commonName', value = {_T, V}} <- ATVs + || ATVs <- RDNSeq, + #'AttributeTypeAndValue'{type = ?'id-at-commonName', value = {_T, V}} <- ATVs ]; get_cn_from_rdn(_) -> []. diff --git a/src/woody_client_thrift_http_transport.erl b/src/woody_client_thrift_http_transport.erl index a332024..7cc56f1 100644 --- a/src/woody_client_thrift_http_transport.erl +++ b/src/woody_client_thrift_http_transport.erl @@ -102,11 +102,13 @@ flush( ) of {ok, Response} -> - {Transport#{ + { + Transport#{ read_buffer => Response, write_buffer => <<>> }, - ok}; + ok + }; Error -> {Transport#{read_buffer => <<>>, write_buffer => <<>>}, Error} end. diff --git a/src/woody_event_formatter.erl b/src/woody_event_formatter.erl index 6e8d3b3..8d3ba58 100644 --- a/src/woody_event_formatter.erl +++ b/src/woody_event_formatter.erl @@ -490,80 +490,79 @@ stop_format(MaybeAddMoreMarker, Result0) -> -define(ARGS2, {{mg_stateproc_CallArgs, - {bin, - <<131, 104, 4, 100, 0, 11, 116, 104, 114, 105, 102, 116, 95, 99, 97, 108, 108, 100, 0, 16, 112, 97, 114, - 116, 121, 95, 109, 97, 110, 97, 103, 101, 109, 101, 110, 116, 104, 2, 100, 0, 15, 80, 97, 114, 116, - 121, 77, 97, 110, 97, 103, 101, 109, 101, 110, 116, 100, 0, 11, 67, 114, 101, 97, 116, 101, 67, 108, - 97, 105, 109, 109, 0, 0, 2, 145, 11, 0, 2, 0, 0, 0, 11, 49, 67, 83, 72, 84, 104, 84, 69, 74, 56, 52, - 15, 0, 3, 12, 0, 0, 0, 4, 12, 0, 4, 11, 0, 1, 0, 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, - 75, 12, 0, 2, 12, 0, 1, 12, 0, 2, 8, 0, 1, 0, 0, 0, 1, 0, 12, 0, 3, 8, 0, 1, 0, 0, 0, 1, 0, 12, 0, - 1, 12, 0, 1, 12, 0, 1, 11, 0, 1, 0, 0, 0, 18, 72, 111, 111, 102, 115, 32, 38, 32, 72, 111, 114, 110, - 115, 32, 79, 74, 83, 67, 11, 0, 2, 0, 0, 0, 10, 49, 50, 51, 52, 53, 48, 57, 56, 55, 54, 11, 0, 3, 0, - 0, 0, 13, 49, 50, 49, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 11, 0, 4, 0, 0, 0, 48, 78, 101, 122, - 97, 104, 117, 97, 108, 99, 111, 121, 111, 116, 108, 32, 49, 48, 57, 32, 80, 105, 115, 111, 32, 56, - 44, 32, 67, 101, 110, 116, 114, 111, 44, 32, 48, 54, 48, 56, 50, 44, 32, 77, 69, 88, 73, 67, 79, 11, - 0, 5, 0, 0, 0, 3, 78, 97, 78, 11, 0, 6, 0, 0, 0, 8, 68, 105, 114, 101, 99, 116, 111, 114, 11, 0, 7, - 0, 0, 0, 7, 83, 111, 109, 101, 111, 110, 101, 11, 0, 8, 0, 0, 0, 13, 49, 48, 48, 36, 32, 98, 97, - 110, 107, 110, 111, 116, 101, 12, 0, 9, 11, 0, 1, 0, 0, 0, 19, 52, 50, 55, 54, 51, 48, 48, 48, 49, - 48, 57, 48, 56, 51, 49, 50, 56, 57, 51, 11, 0, 2, 0, 0, 0, 8, 83, 111, 109, 101, 66, 97, 110, 107, - 11, 0, 3, 0, 0, 0, 9, 49, 50, 51, 49, 50, 57, 56, 55, 54, 11, 0, 4, 0, 0, 0, 8, 54, 54, 54, 52, 50, - 54, 54, 54, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 11, 0, 1, 0, 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, - 108, 51, 52, 75, 12, 0, 2, 12, 0, 4, 11, 0, 1, 0, 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, - 52, 76, 12, 0, 2, 12, 0, 1, 12, 0, 1, 11, 0, 1, 0, 0, 0, 3, 82, 85, 66, 0, 12, 0, 2, 12, 0, 1, 11, - 0, 1, 0, 0, 0, 19, 52, 50, 55, 54, 51, 48, 48, 48, 49, 48, 57, 48, 56, 51, 49, 50, 56, 57, 51, 11, - 0, 2, 0, 0, 0, 8, 83, 111, 109, 101, 66, 97, 110, 107, 11, 0, 3, 0, 0, 0, 9, 49, 50, 51, 49, 50, 57, - 56, 55, 54, 11, 0, 4, 0, 0, 0, 8, 54, 54, 54, 52, 50, 54, 54, 54, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 6, - 11, 0, 1, 0, 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, 77, 12, 0, 2, 12, 0, 5, 12, 0, 1, - 8, 0, 1, 0, 0, 0, 1, 0, 12, 0, 6, 11, 0, 1, 0, 0, 0, 0, 0, 12, 0, 2, 11, 0, 1, 0, 0, 0, 17, 66, 97, - 116, 116, 108, 101, 32, 82, 101, 97, 100, 121, 32, 83, 104, 111, 112, 0, 11, 0, 3, 0, 0, 0, 11, 49, - 67, 83, 72, 84, 106, 75, 108, 51, 52, 75, 11, 0, 4, 0, 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, - 51, 52, 76, 0, 0, 0, 0, 12, 0, 6, 11, 0, 1, 0, 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, - 77, 12, 0, 2, 12, 0, 12, 12, 0, 1, 11, 0, 1, 0, 0, 0, 3, 82, 85, 66, 0, 0, 0, 0, 0, 0>>}, - {mg_stateproc_Machine, <<"party">>, <<"1CSHThTEJ84">>, - [ - {mg_stateproc_Event, 1, <<"2019-08-13T07:52:11.080519Z">>, undefined, - {arr, [ - {obj, #{ - {str, <<"ct">>} => - {str, <<"application/x-erlang-binary">>}, - {str, <<"vsn">>} => {i, 6} - }}, - {bin, - <<131, 104, 2, 100, 0, 13, 112, 97, 114, 116, 121, 95, 99, 104, 97, 110, 103, 101, 115, - 108, 0, 0, 0, 2, 104, 2, 100, 0, 13, 112, 97, 114, 116, 121, 95, 99, 114, 101, 97, - 116, 101, 100, 104, 4, 100, 0, 20, 112, 97, 121, 112, 114, 111, 99, 95, 80, 97, 114, - 116, 121, 67, 114, 101, 97, 116, 101, 100, 109, 0, 0, 0, 11, 49, 67, 83, 72, 84, - 104, 84, 69, 74, 56, 52, 104, 2, 100, 0, 23, 100, 111, 109, 97, 105, 110, 95, 80, - 97, 114, 116, 121, 67, 111, 110, 116, 97, 99, 116, 73, 110, 102, 111, 109, 0, 0, 0, - 12, 104, 103, 95, 99, 116, 95, 104, 101, 108, 112, 101, 114, 109, 0, 0, 0, 27, 50, - 48, 49, 57, 45, 48, 56, 45, 49, 51, 84, 48, 55, 58, 53, 50, 58, 49, 49, 46, 48, 55, - 50, 56, 51, 53, 90, 104, 2, 100, 0, 16, 114, 101, 118, 105, 115, 105, 111, 110, 95, - 99, 104, 97, 110, 103, 101, 100, 104, 3, 100, 0, 28, 112, 97, 121, 112, 114, 111, - 99, 95, 80, 97, 114, 116, 121, 82, 101, 118, 105, 115, 105, 111, 110, 67, 104, 97, - 110, 103, 101, 100, 109, 0, 0, 0, 27, 50, 48, 49, 57, 45, 48, 56, 45, 49, 51, 84, - 48, 55, 58, 53, 50, 58, 49, 49, 46, 48, 55, 50, 56, 51, 53, 90, 97, 0, 106>>} - ]}} - ], - {mg_stateproc_HistoryRange, undefined, 10, backward}, - {mg_stateproc_Content, undefined, - {obj, #{ - {str, <<"aux_state">>} => - {bin, - <<131, 116, 0, 0, 0, 2, 100, 0, 20, 112, 97, 114, 116, 121, 95, 114, 101, 118, 105, 115, - 105, 111, 110, 95, 105, 110, 100, 101, 120, 116, 0, 0, 0, 0, 100, 0, 14, 115, 110, - 97, 112, 115, 104, 111, 116, 95, 105, 110, 100, 101, 120, 106>>}, - {str, <<"ct">>} => {str, <<"application/x-erlang-binary">>} - }}}, - undefined, + {bin, + <<131, 104, 4, 100, 0, 11, 116, 104, 114, 105, 102, 116, 95, 99, 97, 108, 108, 100, 0, 16, 112, 97, 114, + 116, 121, 95, 109, 97, 110, 97, 103, 101, 109, 101, 110, 116, 104, 2, 100, 0, 15, 80, 97, 114, 116, 121, + 77, 97, 110, 97, 103, 101, 109, 101, 110, 116, 100, 0, 11, 67, 114, 101, 97, 116, 101, 67, 108, 97, 105, + 109, 109, 0, 0, 2, 145, 11, 0, 2, 0, 0, 0, 11, 49, 67, 83, 72, 84, 104, 84, 69, 74, 56, 52, 15, 0, 3, + 12, 0, 0, 0, 4, 12, 0, 4, 11, 0, 1, 0, 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, 75, 12, 0, 2, + 12, 0, 1, 12, 0, 2, 8, 0, 1, 0, 0, 0, 1, 0, 12, 0, 3, 8, 0, 1, 0, 0, 0, 1, 0, 12, 0, 1, 12, 0, 1, 12, 0, + 1, 11, 0, 1, 0, 0, 0, 18, 72, 111, 111, 102, 115, 32, 38, 32, 72, 111, 114, 110, 115, 32, 79, 74, 83, + 67, 11, 0, 2, 0, 0, 0, 10, 49, 50, 51, 52, 53, 48, 57, 56, 55, 54, 11, 0, 3, 0, 0, 0, 13, 49, 50, 49, + 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 11, 0, 4, 0, 0, 0, 48, 78, 101, 122, 97, 104, 117, 97, 108, 99, + 111, 121, 111, 116, 108, 32, 49, 48, 57, 32, 80, 105, 115, 111, 32, 56, 44, 32, 67, 101, 110, 116, 114, + 111, 44, 32, 48, 54, 48, 56, 50, 44, 32, 77, 69, 88, 73, 67, 79, 11, 0, 5, 0, 0, 0, 3, 78, 97, 78, 11, + 0, 6, 0, 0, 0, 8, 68, 105, 114, 101, 99, 116, 111, 114, 11, 0, 7, 0, 0, 0, 7, 83, 111, 109, 101, 111, + 110, 101, 11, 0, 8, 0, 0, 0, 13, 49, 48, 48, 36, 32, 98, 97, 110, 107, 110, 111, 116, 101, 12, 0, 9, 11, + 0, 1, 0, 0, 0, 19, 52, 50, 55, 54, 51, 48, 48, 48, 49, 48, 57, 48, 56, 51, 49, 50, 56, 57, 51, 11, 0, 2, + 0, 0, 0, 8, 83, 111, 109, 101, 66, 97, 110, 107, 11, 0, 3, 0, 0, 0, 9, 49, 50, 51, 49, 50, 57, 56, 55, + 54, 11, 0, 4, 0, 0, 0, 8, 54, 54, 54, 52, 50, 54, 54, 54, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 11, 0, 1, 0, + 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, 75, 12, 0, 2, 12, 0, 4, 11, 0, 1, 0, 0, 0, 11, 49, + 67, 83, 72, 84, 106, 75, 108, 51, 52, 76, 12, 0, 2, 12, 0, 1, 12, 0, 1, 11, 0, 1, 0, 0, 0, 3, 82, 85, + 66, 0, 12, 0, 2, 12, 0, 1, 11, 0, 1, 0, 0, 0, 19, 52, 50, 55, 54, 51, 48, 48, 48, 49, 48, 57, 48, 56, + 51, 49, 50, 56, 57, 51, 11, 0, 2, 0, 0, 0, 8, 83, 111, 109, 101, 66, 97, 110, 107, 11, 0, 3, 0, 0, 0, 9, + 49, 50, 51, 49, 50, 57, 56, 55, 54, 11, 0, 4, 0, 0, 0, 8, 54, 54, 54, 52, 50, 54, 54, 54, 0, 0, 0, 0, 0, + 0, 0, 0, 12, 0, 6, 11, 0, 1, 0, 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, 77, 12, 0, 2, 12, 0, + 5, 12, 0, 1, 8, 0, 1, 0, 0, 0, 1, 0, 12, 0, 6, 11, 0, 1, 0, 0, 0, 0, 0, 12, 0, 2, 11, 0, 1, 0, 0, 0, 17, + 66, 97, 116, 116, 108, 101, 32, 82, 101, 97, 100, 121, 32, 83, 104, 111, 112, 0, 11, 0, 3, 0, 0, 0, 11, + 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, 75, 11, 0, 4, 0, 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, + 51, 52, 76, 0, 0, 0, 0, 12, 0, 6, 11, 0, 1, 0, 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, 77, + 12, 0, 2, 12, 0, 12, 12, 0, 1, 11, 0, 1, 0, 0, 0, 3, 82, 85, 66, 0, 0, 0, 0, 0, 0>>}, + {mg_stateproc_Machine, <<"party">>, <<"1CSHThTEJ84">>, + [ + {mg_stateproc_Event, 1, <<"2019-08-13T07:52:11.080519Z">>, undefined, + {arr, [ + {obj, #{ + {str, <<"ct">>} => + {str, <<"application/x-erlang-binary">>}, + {str, <<"vsn">>} => {i, 6} + }}, + {bin, + <<131, 104, 2, 100, 0, 13, 112, 97, 114, 116, 121, 95, 99, 104, 97, 110, 103, 101, 115, 108, + 0, 0, 0, 2, 104, 2, 100, 0, 13, 112, 97, 114, 116, 121, 95, 99, 114, 101, 97, 116, 101, + 100, 104, 4, 100, 0, 20, 112, 97, 121, 112, 114, 111, 99, 95, 80, 97, 114, 116, 121, 67, + 114, 101, 97, 116, 101, 100, 109, 0, 0, 0, 11, 49, 67, 83, 72, 84, 104, 84, 69, 74, 56, + 52, 104, 2, 100, 0, 23, 100, 111, 109, 97, 105, 110, 95, 80, 97, 114, 116, 121, 67, 111, + 110, 116, 97, 99, 116, 73, 110, 102, 111, 109, 0, 0, 0, 12, 104, 103, 95, 99, 116, 95, + 104, 101, 108, 112, 101, 114, 109, 0, 0, 0, 27, 50, 48, 49, 57, 45, 48, 56, 45, 49, 51, + 84, 48, 55, 58, 53, 50, 58, 49, 49, 46, 48, 55, 50, 56, 51, 53, 90, 104, 2, 100, 0, 16, + 114, 101, 118, 105, 115, 105, 111, 110, 95, 99, 104, 97, 110, 103, 101, 100, 104, 3, + 100, 0, 28, 112, 97, 121, 112, 114, 111, 99, 95, 80, 97, 114, 116, 121, 82, 101, 118, + 105, 115, 105, 111, 110, 67, 104, 97, 110, 103, 101, 100, 109, 0, 0, 0, 27, 50, 48, 49, + 57, 45, 48, 56, 45, 49, 51, 84, 48, 55, 58, 53, 50, 58, 49, 49, 46, 48, 55, 50, 56, 51, + 53, 90, 97, 0, 106>>} + ]}} + ], + {mg_stateproc_HistoryRange, undefined, 10, backward}, + {mg_stateproc_Content, undefined, {obj, #{ {str, <<"aux_state">>} => {bin, <<131, 116, 0, 0, 0, 2, 100, 0, 20, 112, 97, 114, 116, 121, 95, 114, 101, 118, 105, 115, 105, 111, 110, 95, 105, 110, 100, 101, 120, 116, 0, 0, 0, 0, 100, 0, 14, 115, 110, 97, 112, 115, 104, 111, 116, 95, 105, 110, 100, 101, 120, 106>>}, - {str, <<"ct">>} => - {str, <<"application/x-erlang-binary">>} - }}}}} + {str, <<"ct">>} => {str, <<"application/x-erlang-binary">>} + }}}, + undefined, + {obj, #{ + {str, <<"aux_state">>} => + {bin, + <<131, 116, 0, 0, 0, 2, 100, 0, 20, 112, 97, 114, 116, 121, 95, 114, 101, 118, 105, 115, 105, + 111, 110, 95, 105, 110, 100, 101, 120, 116, 0, 0, 0, 0, 100, 0, 14, 115, 110, 97, 112, 115, + 104, 111, 116, 95, 105, 110, 100, 101, 120, 106>>}, + {str, <<"ct">>} => + {str, <<"application/x-erlang-binary">>} + }}}}} ). format_msg({Fmt, Params}) -> diff --git a/src/woody_event_handler.erl b/src/woody_event_handler.erl index 1c98372..f4bec0f 100644 --- a/src/woody_event_handler.erl +++ b/src/woody_event_handler.erl @@ -525,8 +525,11 @@ format_service_request_test_() -> ?EV_CALL_SERVICE, #{ args => - {{payproc_UserInfo, <<"1CQdDqPROyW">>, {external_user, {payproc_ExternalUser}}}, undefined, - {payproc_PartyParams, {domain_PartyContactInfo, <<"hg_ct_helper">>}}}, + { + {payproc_UserInfo, <<"1CQdDqPROyW">>, {external_user, {payproc_ExternalUser}}}, + undefined, + {payproc_PartyParams, {domain_PartyContactInfo, <<"hg_ct_helper">>}} + }, deadline => undefined, execution_start_time => 1565596875497, function => 'Create', @@ -616,7 +619,7 @@ format_service_request_test_() -> #{ args => {{payproc_CustomerParams, <<"1CQdDqPROyW">>, <<"1CQdDwgt3R3">>, - {domain_ContactInfo, undefined, <<"invalid_shop">>}, {nl, {json_Null}}}}, + {domain_ContactInfo, undefined, <<"invalid_shop">>}, {nl, {json_Null}}}}, deadline => undefined, execution_start_time => 1565596876258, function => 'Create', @@ -647,8 +650,10 @@ format_service_request_test_() -> ?EV_CALL_SERVICE, #{ args => - {{payproc_UserInfo, <<"1CQdDqPROyW">>, {external_user, {payproc_ExternalUser}}}, - <<"1CQdDqPROyW">>}, + { + {payproc_UserInfo, <<"1CQdDqPROyW">>, {external_user, {payproc_ExternalUser}}}, + <<"1CQdDqPROyW">> + }, deadline => {{{2019, 8, 12}, {8, 1, 46}}, 263}, execution_start_time => 1565596876266, function => 'GetRevision', @@ -679,8 +684,11 @@ format_service_request_test_() -> ?EV_CALL_SERVICE, #{ args => - {{payproc_UserInfo, <<"1CQdDqPROyW">>, {external_user, {payproc_ExternalUser}}}, - <<"1CQdDqPROyW">>, {revision, 1}}, + { + {payproc_UserInfo, <<"1CQdDqPROyW">>, {external_user, {payproc_ExternalUser}}}, + <<"1CQdDqPROyW">>, + {revision, 1} + }, deadline => {{{2019, 8, 12}, {8, 1, 46}}, 263}, execution_start_time => 1565596876292, function => 'Checkout', @@ -771,14 +779,14 @@ format_service_request_test_() -> #{ args => {{mg_stateproc_SignalArgs, - {init, - {mg_stateproc_InitSignal, - {bin, - <<131, 109, 0, 0, 0, 24, 12, 0, 1, 11, 0, 1, 0, 0, 0, 12, 104, 103, 95, - 99, 116, 95, 104, 101, 108, 112, 101, 114, 0, 0>>}}}, - {mg_stateproc_Machine, <<"party">>, <<"1CQxZsCgLJY">>, [], - {mg_stateproc_HistoryRange, undefined, undefined, forward}, - {mg_stateproc_Content, undefined, {bin, <<>>}}, undefined, {bin, <<>>}}}}, + {init, + {mg_stateproc_InitSignal, + {bin, + <<131, 109, 0, 0, 0, 24, 12, 0, 1, 11, 0, 1, 0, 0, 0, 12, 104, 103, 95, 99, + 116, 95, 104, 101, 108, 112, 101, 114, 0, 0>>}}}, + {mg_stateproc_Machine, <<"party">>, <<"1CQxZsCgLJY">>, [], + {mg_stateproc_HistoryRange, undefined, undefined, forward}, + {mg_stateproc_Content, undefined, {bin, <<>>}}, undefined, {bin, <<>>}}}}, deadline => {{{2019, 8, 12}, {12, 46, 36}}, 433}, execution_start_time => 1565613966542, function => 'ProcessSignal', @@ -891,86 +899,73 @@ format_service_request_test_() -> #{ args => {{mg_stateproc_CallArgs, - {bin, - <<131, 104, 4, 100, 0, 11, 116, 104, 114, 105, 102, 116, 95, 99, 97, 108, 108, - 100, 0, 16, 112, 97, 114, 116, 121, 95, 109, 97, 110, 97, 103, 101, 109, - 101, 110, 116, 104, 2, 100, 0, 15, 80, 97, 114, 116, 121, 77, 97, 110, 97, - 103, 101, 109, 101, 110, 116, 100, 0, 11, 67, 114, 101, 97, 116, 101, 67, - 108, 97, 105, 109, 109, 0, 0, 2, 145, 11, 0, 2, 0, 0, 0, 11, 49, 67, 83, 72, - 84, 104, 84, 69, 74, 56, 52, 15, 0, 3, 12, 0, 0, 0, 4, 12, 0, 4, 11, 0, 1, - 0, 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, 75, 12, 0, 2, 12, 0, - 1, 12, 0, 2, 8, 0, 1, 0, 0, 0, 1, 0, 12, 0, 3, 8, 0, 1, 0, 0, 0, 1, 0, 12, - 0, 1, 12, 0, 1, 12, 0, 1, 11, 0, 1, 0, 0, 0, 18, 72, 111, 111, 102, 115, 32, - 38, 32, 72, 111, 114, 110, 115, 32, 79, 74, 83, 67, 11, 0, 2, 0, 0, 0, 10, - 49, 50, 51, 52, 53, 48, 57, 56, 55, 54, 11, 0, 3, 0, 0, 0, 13, 49, 50, 49, - 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 11, 0, 4, 0, 0, 0, 48, 78, 101, 122, - 97, 104, 117, 97, 108, 99, 111, 121, 111, 116, 108, 32, 49, 48, 57, 32, 80, - 105, 115, 111, 32, 56, 44, 32, 67, 101, 110, 116, 114, 111, 44, 32, 48, 54, - 48, 56, 50, 44, 32, 77, 69, 88, 73, 67, 79, 11, 0, 5, 0, 0, 0, 3, 78, 97, - 78, 11, 0, 6, 0, 0, 0, 8, 68, 105, 114, 101, 99, 116, 111, 114, 11, 0, 7, 0, - 0, 0, 7, 83, 111, 109, 101, 111, 110, 101, 11, 0, 8, 0, 0, 0, 13, 49, 48, - 48, 36, 32, 98, 97, 110, 107, 110, 111, 116, 101, 12, 0, 9, 11, 0, 1, 0, 0, - 0, 19, 52, 50, 55, 54, 51, 48, 48, 48, 49, 48, 57, 48, 56, 51, 49, 50, 56, - 57, 51, 11, 0, 2, 0, 0, 0, 8, 83, 111, 109, 101, 66, 97, 110, 107, 11, 0, 3, - 0, 0, 0, 9, 49, 50, 51, 49, 50, 57, 56, 55, 54, 11, 0, 4, 0, 0, 0, 8, 54, - 54, 54, 52, 50, 54, 54, 54, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 11, 0, 1, 0, - 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, 75, 12, 0, 2, 12, 0, 4, - 11, 0, 1, 0, 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, 76, 12, 0, - 2, 12, 0, 1, 12, 0, 1, 11, 0, 1, 0, 0, 0, 3, 82, 85, 66, 0, 12, 0, 2, 12, 0, - 1, 11, 0, 1, 0, 0, 0, 19, 52, 50, 55, 54, 51, 48, 48, 48, 49, 48, 57, 48, - 56, 51, 49, 50, 56, 57, 51, 11, 0, 2, 0, 0, 0, 8, 83, 111, 109, 101, 66, 97, - 110, 107, 11, 0, 3, 0, 0, 0, 9, 49, 50, 51, 49, 50, 57, 56, 55, 54, 11, 0, - 4, 0, 0, 0, 8, 54, 54, 54, 52, 50, 54, 54, 54, 0, 0, 0, 0, 0, 0, 0, 0, 12, - 0, 6, 11, 0, 1, 0, 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, 77, - 12, 0, 2, 12, 0, 5, 12, 0, 1, 8, 0, 1, 0, 0, 0, 1, 0, 12, 0, 6, 11, 0, 1, 0, - 0, 0, 0, 0, 12, 0, 2, 11, 0, 1, 0, 0, 0, 17, 66, 97, 116, 116, 108, 101, 32, - 82, 101, 97, 100, 121, 32, 83, 104, 111, 112, 0, 11, 0, 3, 0, 0, 0, 11, 49, - 67, 83, 72, 84, 106, 75, 108, 51, 52, 75, 11, 0, 4, 0, 0, 0, 11, 49, 67, 83, - 72, 84, 106, 75, 108, 51, 52, 76, 0, 0, 0, 0, 12, 0, 6, 11, 0, 1, 0, 0, 0, - 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, 77, 12, 0, 2, 12, 0, 12, 12, - 0, 1, 11, 0, 1, 0, 0, 0, 3, 82, 85, 66, 0, 0, 0, 0, 0, 0>>}, - {mg_stateproc_Machine, <<"party">>, <<"1CSHThTEJ84">>, - [ - {mg_stateproc_Event, 1, <<"2019-08-13T07:52:11.080519Z">>, undefined, - {arr, [ - {obj, #{ - {str, <<"ct">>} => - {str, <<"application/x-erlang-binary">>}, - {str, <<"vsn">>} => {i, 6} - }}, - {bin, - <<131, 104, 2, 100, 0, 13, 112, 97, 114, 116, 121, 95, 99, 104, - 97, 110, 103, 101, 115, 108, 0, 0, 0, 2, 104, 2, 100, 0, 13, - 112, 97, 114, 116, 121, 95, 99, 114, 101, 97, 116, 101, 100, - 104, 4, 100, 0, 20, 112, 97, 121, 112, 114, 111, 99, 95, 80, - 97, 114, 116, 121, 67, 114, 101, 97, 116, 101, 100, 109, 0, - 0, 0, 11, 49, 67, 83, 72, 84, 104, 84, 69, 74, 56, 52, 104, - 2, 100, 0, 23, 100, 111, 109, 97, 105, 110, 95, 80, 97, 114, - 116, 121, 67, 111, 110, 116, 97, 99, 116, 73, 110, 102, 111, - 109, 0, 0, 0, 12, 104, 103, 95, 99, 116, 95, 104, 101, 108, - 112, 101, 114, 109, 0, 0, 0, 27, 50, 48, 49, 57, 45, 48, 56, - 45, 49, 51, 84, 48, 55, 58, 53, 50, 58, 49, 49, 46, 48, 55, - 50, 56, 51, 53, 90, 104, 2, 100, 0, 16, 114, 101, 118, 105, - 115, 105, 111, 110, 95, 99, 104, 97, 110, 103, 101, 100, - 104, 3, 100, 0, 28, 112, 97, 121, 112, 114, 111, 99, 95, 80, - 97, 114, 116, 121, 82, 101, 118, 105, 115, 105, 111, 110, - 67, 104, 97, 110, 103, 101, 100, 109, 0, 0, 0, 27, 50, 48, - 49, 57, 45, 48, 56, 45, 49, 51, 84, 48, 55, 58, 53, 50, 58, - 49, 49, 46, 48, 55, 50, 56, 51, 53, 90, 97, 0, 106>>} - ]}} - ], - {mg_stateproc_HistoryRange, undefined, 10, backward}, - {mg_stateproc_Content, undefined, - {obj, #{ - {str, <<"aux_state">>} => - {bin, - <<131, 116, 0, 0, 0, 2, 100, 0, 20, 112, 97, 114, 116, 121, 95, - 114, 101, 118, 105, 115, 105, 111, 110, 95, 105, 110, 100, - 101, 120, 116, 0, 0, 0, 0, 100, 0, 14, 115, 110, 97, 112, - 115, 104, 111, 116, 95, 105, 110, 100, 101, 120, 106>>}, - {str, <<"ct">>} => {str, <<"application/x-erlang-binary">>} - }}}, - undefined, + {bin, + <<131, 104, 4, 100, 0, 11, 116, 104, 114, 105, 102, 116, 95, 99, 97, 108, 108, 100, + 0, 16, 112, 97, 114, 116, 121, 95, 109, 97, 110, 97, 103, 101, 109, 101, 110, + 116, 104, 2, 100, 0, 15, 80, 97, 114, 116, 121, 77, 97, 110, 97, 103, 101, 109, + 101, 110, 116, 100, 0, 11, 67, 114, 101, 97, 116, 101, 67, 108, 97, 105, 109, + 109, 0, 0, 2, 145, 11, 0, 2, 0, 0, 0, 11, 49, 67, 83, 72, 84, 104, 84, 69, 74, + 56, 52, 15, 0, 3, 12, 0, 0, 0, 4, 12, 0, 4, 11, 0, 1, 0, 0, 0, 11, 49, 67, 83, + 72, 84, 106, 75, 108, 51, 52, 75, 12, 0, 2, 12, 0, 1, 12, 0, 2, 8, 0, 1, 0, 0, + 0, 1, 0, 12, 0, 3, 8, 0, 1, 0, 0, 0, 1, 0, 12, 0, 1, 12, 0, 1, 12, 0, 1, 11, 0, + 1, 0, 0, 0, 18, 72, 111, 111, 102, 115, 32, 38, 32, 72, 111, 114, 110, 115, 32, + 79, 74, 83, 67, 11, 0, 2, 0, 0, 0, 10, 49, 50, 51, 52, 53, 48, 57, 56, 55, 54, + 11, 0, 3, 0, 0, 0, 13, 49, 50, 49, 51, 52, 53, 54, 55, 56, 57, 48, 49, 50, 11, + 0, 4, 0, 0, 0, 48, 78, 101, 122, 97, 104, 117, 97, 108, 99, 111, 121, 111, 116, + 108, 32, 49, 48, 57, 32, 80, 105, 115, 111, 32, 56, 44, 32, 67, 101, 110, 116, + 114, 111, 44, 32, 48, 54, 48, 56, 50, 44, 32, 77, 69, 88, 73, 67, 79, 11, 0, 5, + 0, 0, 0, 3, 78, 97, 78, 11, 0, 6, 0, 0, 0, 8, 68, 105, 114, 101, 99, 116, 111, + 114, 11, 0, 7, 0, 0, 0, 7, 83, 111, 109, 101, 111, 110, 101, 11, 0, 8, 0, 0, 0, + 13, 49, 48, 48, 36, 32, 98, 97, 110, 107, 110, 111, 116, 101, 12, 0, 9, 11, 0, + 1, 0, 0, 0, 19, 52, 50, 55, 54, 51, 48, 48, 48, 49, 48, 57, 48, 56, 51, 49, 50, + 56, 57, 51, 11, 0, 2, 0, 0, 0, 8, 83, 111, 109, 101, 66, 97, 110, 107, 11, 0, 3, + 0, 0, 0, 9, 49, 50, 51, 49, 50, 57, 56, 55, 54, 11, 0, 4, 0, 0, 0, 8, 54, 54, + 54, 52, 50, 54, 54, 54, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 4, 11, 0, 1, 0, 0, 0, 11, + 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, 75, 12, 0, 2, 12, 0, 4, 11, 0, 1, 0, + 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, 76, 12, 0, 2, 12, 0, 1, 12, + 0, 1, 11, 0, 1, 0, 0, 0, 3, 82, 85, 66, 0, 12, 0, 2, 12, 0, 1, 11, 0, 1, 0, 0, + 0, 19, 52, 50, 55, 54, 51, 48, 48, 48, 49, 48, 57, 48, 56, 51, 49, 50, 56, 57, + 51, 11, 0, 2, 0, 0, 0, 8, 83, 111, 109, 101, 66, 97, 110, 107, 11, 0, 3, 0, 0, + 0, 9, 49, 50, 51, 49, 50, 57, 56, 55, 54, 11, 0, 4, 0, 0, 0, 8, 54, 54, 54, 52, + 50, 54, 54, 54, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 6, 11, 0, 1, 0, 0, 0, 11, 49, 67, + 83, 72, 84, 106, 75, 108, 51, 52, 77, 12, 0, 2, 12, 0, 5, 12, 0, 1, 8, 0, 1, 0, + 0, 0, 1, 0, 12, 0, 6, 11, 0, 1, 0, 0, 0, 0, 0, 12, 0, 2, 11, 0, 1, 0, 0, 0, 17, + 66, 97, 116, 116, 108, 101, 32, 82, 101, 97, 100, 121, 32, 83, 104, 111, 112, 0, + 11, 0, 3, 0, 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, 75, 11, 0, 4, + 0, 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, 76, 0, 0, 0, 0, 12, 0, 6, + 11, 0, 1, 0, 0, 0, 11, 49, 67, 83, 72, 84, 106, 75, 108, 51, 52, 77, 12, 0, 2, + 12, 0, 12, 12, 0, 1, 11, 0, 1, 0, 0, 0, 3, 82, 85, 66, 0, 0, 0, 0, 0, 0>>}, + {mg_stateproc_Machine, <<"party">>, <<"1CSHThTEJ84">>, + [ + {mg_stateproc_Event, 1, <<"2019-08-13T07:52:11.080519Z">>, undefined, + {arr, [ + {obj, #{ + {str, <<"ct">>} => + {str, <<"application/x-erlang-binary">>}, + {str, <<"vsn">>} => {i, 6} + }}, + {bin, + <<131, 104, 2, 100, 0, 13, 112, 97, 114, 116, 121, 95, 99, 104, 97, + 110, 103, 101, 115, 108, 0, 0, 0, 2, 104, 2, 100, 0, 13, 112, + 97, 114, 116, 121, 95, 99, 114, 101, 97, 116, 101, 100, 104, 4, + 100, 0, 20, 112, 97, 121, 112, 114, 111, 99, 95, 80, 97, 114, + 116, 121, 67, 114, 101, 97, 116, 101, 100, 109, 0, 0, 0, 11, 49, + 67, 83, 72, 84, 104, 84, 69, 74, 56, 52, 104, 2, 100, 0, 23, + 100, 111, 109, 97, 105, 110, 95, 80, 97, 114, 116, 121, 67, 111, + 110, 116, 97, 99, 116, 73, 110, 102, 111, 109, 0, 0, 0, 12, 104, + 103, 95, 99, 116, 95, 104, 101, 108, 112, 101, 114, 109, 0, 0, + 0, 27, 50, 48, 49, 57, 45, 48, 56, 45, 49, 51, 84, 48, 55, 58, + 53, 50, 58, 49, 49, 46, 48, 55, 50, 56, 51, 53, 90, 104, 2, 100, + 0, 16, 114, 101, 118, 105, 115, 105, 111, 110, 95, 99, 104, 97, + 110, 103, 101, 100, 104, 3, 100, 0, 28, 112, 97, 121, 112, 114, + 111, 99, 95, 80, 97, 114, 116, 121, 82, 101, 118, 105, 115, 105, + 111, 110, 67, 104, 97, 110, 103, 101, 100, 109, 0, 0, 0, 27, 50, + 48, 49, 57, 45, 48, 56, 45, 49, 51, 84, 48, 55, 58, 53, 50, 58, + 49, 49, 46, 48, 55, 50, 56, 51, 53, 90, 97, 0, 106>>} + ]}} + ], + {mg_stateproc_HistoryRange, undefined, 10, backward}, + {mg_stateproc_Content, undefined, {obj, #{ {str, <<"aux_state">>} => {bin, @@ -978,9 +973,19 @@ format_service_request_test_() -> 101, 118, 105, 115, 105, 111, 110, 95, 105, 110, 100, 101, 120, 116, 0, 0, 0, 0, 100, 0, 14, 115, 110, 97, 112, 115, 104, 111, 116, 95, 105, 110, 100, 101, 120, 106>>}, - {str, <<"ct">>} => - {str, <<"application/x-erlang-binary">>} - }}}}}, + {str, <<"ct">>} => {str, <<"application/x-erlang-binary">>} + }}}, + undefined, + {obj, #{ + {str, <<"aux_state">>} => + {bin, + <<131, 116, 0, 0, 0, 2, 100, 0, 20, 112, 97, 114, 116, 121, 95, 114, + 101, 118, 105, 115, 105, 111, 110, 95, 105, 110, 100, 101, 120, 116, + 0, 0, 0, 0, 100, 0, 14, 115, 110, 97, 112, 115, 104, 111, 116, 95, + 105, 110, 100, 101, 120, 106>>}, + {str, <<"ct">>} => + {str, <<"application/x-erlang-binary">>} + }}}}}, deadline => {{{2019, 8, 13}, {7, 52, 41}}, 105}, execution_start_time => 1565682731109, function => 'ProcessCall', @@ -1191,8 +1196,11 @@ result_test_() -> ?EV_SERVICE_HANDLER_RESULT, #{ args => - {{payproc_UserInfo, <<"1CSWG2vduGe">>, {external_user, {payproc_ExternalUser}}}, - <<"1CSWG2vduGe">>, {revision, 6}}, + { + {payproc_UserInfo, <<"1CSWG2vduGe">>, {external_user, {payproc_ExternalUser}}}, + <<"1CSWG2vduGe">>, + {revision, 6} + }, deadline => {{{2019, 8, 13}, {11, 19, 33}}, 42}, execution_start_time => 1565695143068, function => 'Checkout', @@ -1272,17 +1280,17 @@ result_test_() -> #{ args => {{mg_stateproc_SignalArgs, - {init, - {mg_stateproc_InitSignal, - {bin, - <<131, 109, 0, 0, 0, 71, 11, 0, 1, 0, 0, 0, 11, 49, 67, 83, 87, 71, 50, - 118, 100, 117, 71, 101, 11, 0, 2, 0, 0, 0, 11, 49, 67, 83, 87, 71, - 56, 106, 48, 52, 119, 77, 12, 0, 3, 11, 0, 2, 0, 0, 0, 15, 99, 114, - 101, 97, 116, 101, 95, 99, 117, 115, 116, 111, 109, 101, 114, 0, 12, - 0, 4, 12, 0, 1, 0, 0, 0>>}}}, - {mg_stateproc_Machine, <<"customer">>, <<"1CSWGJ3N8Ns">>, [], - {mg_stateproc_HistoryRange, undefined, undefined, forward}, - {mg_stateproc_Content, undefined, {bin, <<>>}}, undefined, {bin, <<>>}}}}, + {init, + {mg_stateproc_InitSignal, + {bin, + <<131, 109, 0, 0, 0, 71, 11, 0, 1, 0, 0, 0, 11, 49, 67, 83, 87, 71, 50, 118, + 100, 117, 71, 101, 11, 0, 2, 0, 0, 0, 11, 49, 67, 83, 87, 71, 56, 106, + 48, 52, 119, 77, 12, 0, 3, 11, 0, 2, 0, 0, 0, 15, 99, 114, 101, 97, 116, + 101, 95, 99, 117, 115, 116, 111, 109, 101, 114, 0, 12, 0, 4, 12, 0, 1, + 0, 0, 0>>}}}, + {mg_stateproc_Machine, <<"customer">>, <<"1CSWGJ3N8Ns">>, [], + {mg_stateproc_HistoryRange, undefined, undefined, forward}, + {mg_stateproc_Content, undefined, {bin, <<>>}}, undefined, {bin, <<>>}}}}, deadline => {{{2019, 8, 13}, {11, 19, 33}}, 606}, execution_start_time => 1565695143707, function => 'ProcessSignal', @@ -1344,17 +1352,17 @@ result_test_() -> #{ args => {{mg_stateproc_SignalArgs, - {init, - {mg_stateproc_InitSignal, - {bin, - <<131, 109, 0, 0, 0, 71, 11, 0, 1, 0, 0, 0, 11, 49, 67, 83, 87, 71, 50, - 118, 100, 117, 71, 101, 11, 0, 2, 0, 0, 0, 11, 49, 67, 83, 87, 71, - 56, 106, 48, 52, 119, 77, 12, 0, 3, 11, 0, 2, 0, 0, 0, 15, 99, 114, - 101, 97, 116, 101, 95, 99, 117, 115, 116, 111, 109, 101, 114, 0, 12, - 0, 4, 12, 0, 1, 0, 0, 0>>}}}, - {mg_stateproc_Machine, <<"customer">>, <<"1CSWGJ3N8Ns">>, [], - {mg_stateproc_HistoryRange, undefined, undefined, forward}, - {mg_stateproc_Content, undefined, {bin, <<>>}}, undefined, {bin, <<>>}}}}, + {init, + {mg_stateproc_InitSignal, + {bin, + <<131, 109, 0, 0, 0, 71, 11, 0, 1, 0, 0, 0, 11, 49, 67, 83, 87, 71, 50, 118, + 100, 117, 71, 101, 11, 0, 2, 0, 0, 0, 11, 49, 67, 83, 87, 71, 56, 106, + 48, 52, 119, 77, 12, 0, 3, 11, 0, 2, 0, 0, 0, 15, 99, 114, 101, 97, 116, + 101, 95, 99, 117, 115, 116, 111, 109, 101, 114, 0, 12, 0, 4, 12, 0, 1, + 0, 0, 0>>}}}, + {mg_stateproc_Machine, <<"customer">>, <<"1CSWGJ3N8Ns">>, [], + {mg_stateproc_HistoryRange, undefined, undefined, forward}, + {mg_stateproc_Content, undefined, {bin, <<>>}}, undefined, {bin, <<>>}}}}, deadline => {{{2019, 8, 13}, {11, 19, 33}}, 606}, execution_start_time => 1565695143707, function => 'ProcessSignal', diff --git a/src/woody_server_thrift_handler.erl b/src/woody_server_thrift_handler.erl index 9bdfa53..204fb04 100644 --- a/src/woody_server_thrift_handler.erl +++ b/src/woody_server_thrift_handler.erl @@ -350,11 +350,13 @@ handle_internal_error(Error, ExcClass, Stack, State = #{woody_state := WoodyStat WoodyState, #{class => system, result => Error, except_class => ExcClass, stack => Stack, ignore => false} ), - {{error, + { + {error, {system, {internal, result_unexpected, format_unexpected_error(ExcClass, woody_error:format_details(Error), Stack)}}}, - State}. + State + }. -spec encode_reply(ok | {error, woody_error:business_error()}, _Result, state()) -> {ok | {error, woody_error:error()}, state()}. diff --git a/test/meter_memory_pressure.erl b/test/meter_memory_pressure.erl index fc4ba49..bf50a99 100644 --- a/test/meter_memory_pressure.erl +++ b/test/meter_memory_pressure.erl @@ -146,8 +146,8 @@ max(Name, Info1, Info2) -> combine(Name, fun erlang:max/2, Info1, Info2). combine(Name, Fun, Info1, Info2) -> - {_Name, V1} = lists:keyfind(Name, 1, Info1), - {_Name, V2} = lists:keyfind(Name, 1, Info2), + {_, V1} = lists:keyfind(Name, 1, Info1), + {_, V2} = lists:keyfind(Name, 1, Info2), Fun(V1, V2). increment(Name, Metrics) -> diff --git a/test/server_timeout_event_handler.erl b/test/server_timeout_event_handler.erl index 19d0ecf..b061fc5 100644 --- a/test/server_timeout_event_handler.erl +++ b/test/server_timeout_event_handler.erl @@ -62,8 +62,12 @@ init(_) -> -spec handle_call(get_number_of_events | {event(), rpc_id(), event_meta(), options()}, _, state()) -> {reply, ok | {ok, non_neg_integer()}, state()}. handle_call( - {Event = ?EV_SERVICE_HANDLER_RESULT, Rpc, #{status := error, class := system, result := ?SOCKET_CLOSED} = Meta, - Opts}, + { + Event = ?EV_SERVICE_HANDLER_RESULT, + Rpc, + #{status := error, class := system, result := ?SOCKET_CLOSED} = Meta, + Opts + }, _, #{ socket_errors_caught := Caught diff --git a/test/woody_tests_SUITE.erl b/test/woody_tests_SUITE.erl index fa1cf0a..04f786b 100644 --- a/test/woody_tests_SUITE.erl +++ b/test/woody_tests_SUITE.erl @@ -5,7 +5,7 @@ -include_lib("hackney/include/hackney_lib.hrl"). -include("woody_test_thrift.hrl"). --include("src/woody_defs.hrl"). +-include("woody_defs.hrl"). -behaviour(supervisor). -behaviour(woody_server_thrift_handler). @@ -443,10 +443,12 @@ get_handler('Powerups') -> get_handler('Weapons') -> { ?PATH_WEAPONS, - {{?THRIFT_DEFS, 'Weapons'}, + { + {?THRIFT_DEFS, 'Weapons'}, {?MODULE, #{ meta_test_id => <<"call_seq_with_context_meta">> - }}} + }} + } }. get_fail_code(call_no_headers_404_test) -> 404; @@ -936,9 +938,10 @@ calls_with_cache(_) -> -define(HACKNEY_URL(Scheme, Netloc, Path), #hackney_url{scheme = Scheme, netloc = Netloc, raw_path = Path}). --define(RESPONSE(Scheme, OldNetloc, NewNetloc, Path), - {?HACKNEY_URL(Scheme, OldNetloc, Path), ?HACKNEY_URL(Scheme, NewNetloc, Path)} -). +-define(RESPONSE(Scheme, OldNetloc, NewNetloc, Path), { + ?HACKNEY_URL(Scheme, OldNetloc, Path), + ?HACKNEY_URL(Scheme, NewNetloc, Path) +}). woody_resolver_inet(C) -> WoodyState = woody_state:new(client, woody_context:new(), ?MODULE),