From bc7c7ecf0f23eeb253ed03ed9b8167fb15caa2f0 Mon Sep 17 00:00:00 2001 From: Nelson Vides Date: Thu, 22 Aug 2024 11:18:06 +0200 Subject: [PATCH 1/2] Bump dependencies and Erlang versions --- .github/workflows/ci.yml | 35 +++++------ rebar.config | 4 +- rebar.lock | 102 ++++++++++++++++---------------- src/scenarios/gdpr_removal.erl | 4 +- src/scenarios/pubsub_pep.erl | 2 +- src/scenarios/pubsub_simple.erl | 2 +- 6 files changed, 72 insertions(+), 77 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1bc2617..8b8712a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,19 +10,18 @@ on: jobs: test: - name: OTP ${{matrix.otp}} + name: OTP ${{matrix.otp_vsn}} strategy: matrix: - otp: ['25.3', '24.3.4.9'] - runs-on: 'ubuntu-22.04' + otp_vsn: ['27', '26', '25'] + rebar_vsn: ['3.23.0'] + runs-on: 'ubuntu-24.04' steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 + - uses: actions/checkout@v4 - uses: erlef/setup-beam@v1 with: - otp-version: ${{ matrix.otp }} - rebar3-version: '3.16.1' + otp-version: ${{ matrix.otp_vsn }} + rebar3-version: ${{ matrix.rebar_vsn }} - name: Compile project run: rebar3 compile - name: run xref check @@ -31,17 +30,15 @@ jobs: run: rebar3 dialyzer integration_test: - name: docker container test with OTP ${{matrix.otp}} + name: docker container test with OTP ${{matrix.otp_vsn}} strategy: matrix: - otp: ['25.3', '24.3.4.9'] - runs-on: 'ubuntu-22.04' + otp_vsn: ['27', '26', '25'] + runs-on: 'ubuntu-24.04' env: - OTP_RELEASE: ${{ matrix.otp }} + OTP_RELEASE: ${{ matrix.otp_vsn }} steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 + - uses: actions/checkout@v4 - name: build docker image run: ./ci/build_docker_image.sh - name: test docker image @@ -53,17 +50,15 @@ jobs: docker_image: name: build and push multi-platform docker image - runs-on: 'ubuntu-22.04' + runs-on: 'ubuntu-24.04' needs: - test - integration_test if: github.ref == 'refs/heads/master' env: - OTP_RELEASE: 25.3 + OTP_RELEASE: 27.0 steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 + - uses: actions/checkout@v4 - name: Set up QEMU uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx diff --git a/rebar.config b/rebar.config index 9192598..490000a 100644 --- a/rebar.config +++ b/rebar.config @@ -4,8 +4,8 @@ { deps, [ {amoc_arsenal, {git, "https://github.com/esl/amoc-arsenal.git", {branch, "main"}}}, - {escalus, "4.2.7"}, - {jiffy, "1.1.1"}, + {escalus, "4.2.15"}, + {jiffy, "1.1.2"}, {fusco, "0.1.1"} ]}. diff --git a/rebar.lock b/rebar.lock index 4f2e9b6..89f0956 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,21 +1,21 @@ {"1.2.0", -[{<<"amoc">>,{pkg,<<"amoc">>,<<"3.0.0">>},1}, +[{<<"amoc">>,{pkg,<<"amoc">>,<<"3.3.0">>},1}, {<<"amoc_arsenal">>, {git,"https://github.com/esl/amoc-arsenal.git", - {ref,"1922067af08bc36bb82d2d7be4970d2b5a3a8e8c"}}, + {ref,"c4c801628e27e13554e3e77fa4fcb8e8b986a384"}}, 0}, {<<"amoc_rest">>, {git,"https://github.com/esl/amoc_rest.git", - {ref,"103c3123a8cf0464b9c3f9392af6a396673f67bd"}}, + {ref,"1e41be5b6b332a827d125380fa4f7ea23a00748e"}}, 1}, {<<"base16">>,{pkg,<<"base16">>,<<"2.0.1">>},1}, {<<"bbmustache">>,{pkg,<<"bbmustache">>,<<"1.12.2">>},1}, {<<"bear">>,{pkg,<<"bear">>,<<"1.0.0">>},2}, - {<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.9.0">>},2}, - {<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.11.0">>},2}, + {<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.12.0">>},2}, + {<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.12.1">>},2}, {<<"docsh">>,{pkg,<<"docsh">>,<<"0.7.2">>},1}, - {<<"escalus">>,{pkg,<<"escalus">>,<<"4.2.7">>},0}, - {<<"exml">>,{pkg,<<"hexml">>,<<"3.1.1">>},1}, + {<<"escalus">>,{pkg,<<"escalus">>,<<"4.2.15">>},0}, + {<<"exml">>,{pkg,<<"hexml">>,<<"3.4.1">>},1}, {<<"exometer_core">>, {git,"https://github.com/esl/exometer_core.git", {ref,"123daa053a4abb3ff4bdbf52f08344da535294e9"}}, @@ -24,82 +24,82 @@ {git,"https://github.com/esl/exometer_report_graphite.git", {ref,"59e475a094818294443de9dc68e08ee0116a5626"}}, 1}, - {<<"fast_pbkdf2">>,{pkg,<<"fast_pbkdf2">>,<<"1.0.3">>},2}, - {<<"fast_scram">>,{pkg,<<"fast_scram">>,<<"0.4.4">>},1}, - {<<"fast_tls">>,{pkg,<<"fast_tls">>,<<"1.1.13">>},1}, + {<<"fast_pbkdf2">>,{pkg,<<"fast_pbkdf2">>,<<"1.0.5">>},2}, + {<<"fast_scram">>,{pkg,<<"fast_scram">>,<<"0.6.0">>},1}, + {<<"fast_tls">>,{pkg,<<"fast_tls">>,<<"1.1.21">>},1}, {<<"fusco">>,{pkg,<<"fusco">>,<<"0.1.1">>},0}, {<<"getopt">>,{pkg,<<"getopt">>,<<"1.0.1">>},3}, - {<<"gun">>,{pkg,<<"gun">>,<<"2.0.0-rc.2">>},1}, - {<<"jesse">>,{pkg,<<"jesse">>,<<"1.5.6">>},2}, - {<<"jiffy">>,{pkg,<<"jiffy">>,<<"1.1.1">>},0}, + {<<"gun">>,{pkg,<<"gun">>,<<"2.0.1">>},1}, + {<<"jesse">>,{pkg,<<"jesse">>,<<"1.8.0">>},2}, + {<<"jiffy">>,{pkg,<<"jiffy">>,<<"1.1.2">>},0}, {<<"jsx">>,{pkg,<<"jsx">>,<<"3.1.0">>},2}, {<<"meck">>,{pkg,<<"meck">>,<<"0.9.2">>},1}, - {<<"p1_utils">>,{pkg,<<"p1_utils">>,<<"1.0.23">>},2}, + {<<"p1_utils">>,{pkg,<<"p1_utils">>,<<"1.0.26">>},2}, {<<"parse_trans">>,{pkg,<<"parse_trans">>,<<"3.4.0">>},2}, {<<"providers">>,{pkg,<<"providers">>,<<"1.8.1">>},2}, - {<<"quickrand">>,{pkg,<<"quickrand">>,<<"2.0.5">>},2}, - {<<"ranch">>,{pkg,<<"ranch">>,<<"1.8.0">>},3}, - {<<"rfc3339">>,{pkg,<<"rfc3339">>,<<"0.9.0">>},2}, + {<<"quickrand">>,{pkg,<<"quickrand">>,<<"2.0.7">>},2}, + {<<"ranch">>,{pkg,<<"ranch">>,<<"2.1.0">>},2}, + {<<"rfc3339">>,{pkg,<<"rfc3339">>,<<"0.9.0">>},3}, {<<"telemetry">>,{pkg,<<"telemetry">>,<<"1.2.1">>},1}, - {<<"uuid">>,{pkg,<<"uuid_erl">>,<<"2.0.5">>},1}, - {<<"worker_pool">>,{pkg,<<"worker_pool">>,<<"6.0.0">>},1}]}. + {<<"uuid">>,{pkg,<<"uuid_erl">>,<<"2.0.7">>},1}, + {<<"worker_pool">>,{pkg,<<"worker_pool">>,<<"6.2.1">>},1}]}. [ {pkg_hash,[ - {<<"amoc">>, <<"DFBE52A36237EE7659D9E691F392E16DC5634346800CBB4A1F971143984C1DC1">>}, + {<<"amoc">>, <<"531B7E8CE39D40B4BF5A819868091C4451DC3D3FDAE753E3E3B1D0E5E8E81CDD">>}, {<<"base16">>, <<"F0549F732E03BE8124ED0D19FD5EE52146CC8BE24C48CBC3F23AB44B157F11A2">>}, {<<"bbmustache">>, <<"0CABDCE0DB9FE6D3318131174B9F2B351328A4C0AFBEB3E6E99BB0E02E9B621D">>}, {<<"bear">>, <<"430419C1126B477686CDE843E88BA0F2C7DC5CDF0881C677500074F704339A99">>}, - {<<"cowboy">>, <<"865DD8B6607E14CF03282E10E934023A1BD8BE6F6BACF921A7E2A96D800CD452">>}, - {<<"cowlib">>, <<"0B9FF9C346629256C42EBE1EEB769A83C6CB771A6EE5960BD110AB0B9B872063">>}, + {<<"cowboy">>, <<"F276D521A1FF88B2B9B4C54D0E753DA6C66DD7BE6C9FCA3D9418B561828A3731">>}, + {<<"cowlib">>, <<"A9FA9A625F1D2025FE6B462CB865881329B5CAFF8F1854D1CBC9F9533F00E1E1">>}, {<<"docsh">>, <<"F893D5317A0E14269DD7FE79CF95FB6B9BA23513DA0480EC6E77C73221CAE4F2">>}, - {<<"escalus">>, <<"496D14C505224023C4296E11A8A4C231036517A5E739FACF0C5F87277E48A61A">>}, - {<<"exml">>, <<"125CA2FEF7F960B1B4B7D4B06FA77EDBCD49C458F7B9CD564AB61DF3F937815C">>}, - {<<"fast_pbkdf2">>, <<"4F09D6C6C20DBEE1970E0A6AE91432E1B7731F88426C671D083BAC31FFA1FDAD">>}, - {<<"fast_scram">>, <<"299A2D430955A62A94CB43B1A727C5D21A5C4BD11AEBA476AE2F3A24CFBE89C3">>}, - {<<"fast_tls">>, <<"828CDC75E1E8FCE8158846D2B971D8B4FE2B2DDCC75B759E88D751079BF78AFD">>}, + {<<"escalus">>, <<"1F153CFBEAA67B012F7A34D0AD61A8CD68ED7C0BF9F02B94606B339FBCDCD617">>}, + {<<"exml">>, <<"9581FE6512D9772C61BBE611CD4A8E5BB90B4D4481275325EC520F7A931A9393">>}, + {<<"fast_pbkdf2">>, <<"6045138C4C209FC8222A0B18B2CB1D7BD7407EF4ADAD0F14C5E0F7F4726E3E41">>}, + {<<"fast_scram">>, <<"70724F584A118DA147A51EE38DEE56203F217D58AD61E0BB2C2EF834C16B35B8">>}, + {<<"fast_tls">>, <<"65D7D547A09EEFB37A1C0D04D8601FAC4F3E6E2C1EDE859A7787081670F9648D">>}, {<<"fusco">>, <<"3DD6A90151DFEF30EA1937CC44E9A59177C0094918388D9BCAA2F2DC5E2AE4AA">>}, {<<"getopt">>, <<"C73A9FA687B217F2FF79F68A3B637711BB1936E712B521D8CE466B29CBF7808A">>}, - {<<"gun">>, <<"7C489A32DEDCCB77B6E82D1F3C5A7DADFBFA004EC14E322CDB5E579C438632D2">>}, - {<<"jesse">>, <<"593B8CAD26AF3CC0E44C727BD8CBDE56E2B0DE4C8D2738B1C258B6936A40A6A3">>}, - {<<"jiffy">>, <<"ACA10F47AA91697BF24AB9582C74E00E8E95474C7EF9F76D4F1A338D0F5DE21B">>}, + {<<"gun">>, <<"160A9A5394800FCBA41BC7E6D421295CF9A7894C2252C0678244948E3336AD73">>}, + {<<"jesse">>, <<"CF7615C3F2BE892F77BCCF736F23B4BD54A0FC686C7040431AEBA5EF7932CC4D">>}, + {<<"jiffy">>, <<"A9B6C9A7EC268E7CF493D028F0A4C9144F59CCB878B1AFE42841597800840A1B">>}, {<<"jsx">>, <<"D12516BAA0BB23A59BB35DCCAF02A1BD08243FCBB9EFE24F2D9D056CCFF71268">>}, {<<"meck">>, <<"85CCBAB053F1DB86C7CA240E9FC718170EE5BDA03810A6292B5306BF31BAE5F5">>}, - {<<"p1_utils">>, <<"7F94466ADA69BD982EA7BB80FBCA18E7053E7D0B82C9D9E37621FA508587069B">>}, + {<<"p1_utils">>, <<"67B0C4AC9FA3BA3EF563B31AA111B0A004439A37FAC85E027F1C3617E1C7EC6C">>}, {<<"parse_trans">>, <<"BB87AC362A03CA674EBB7D9D498F45C03256ADED7214C9101F7035EF44B798C7">>}, {<<"providers">>, <<"70B4197869514344A8A60E2B2A4EF41CA03DEF43CFB1712ECF076A0F3C62F083">>}, - {<<"quickrand">>, <<"06FCAD85CB47D5C85C51D6BC9C84A082501BA098A89D64AD0A2F69599E034C04">>}, - {<<"ranch">>, <<"8C7A100A139FD57F17327B6413E4167AC559FBC04CA7448E9BE9057311597A1D">>}, + {<<"quickrand">>, <<"D2BD76676A446E6A058D678444B7FDA1387B813710D1AF6D6E29BB92186C8820">>}, + {<<"ranch">>, <<"2261F9ED9574DCFCC444106B9F6DA155E6E540B2F82BA3D42B339B93673B72A3">>}, {<<"rfc3339">>, <<"2075653DC9407541C84B1E15F8BDA2ABE95FB17C9694025E079583F2D19C1060">>}, {<<"telemetry">>, <<"68FDFE8D8F05A8428483A97D7AAB2F268AAFF24B49E0F599FAA091F1D4E7F61C">>}, - {<<"uuid">>, <<"60FAEEB7EDFD40847ED13CB0DD1044BAABE4E79A00C0CA9C4D13A073914B1016">>}, - {<<"worker_pool">>, <<"F7B442B30121EED6D8C828833533E5C15DB61E4AB2EF343C8B67824267656822">>}]}, + {<<"uuid">>, <<"B2078D2CC814F53AFA52D36C91E08962C7E7373585C623F4C0EA6DFB04B2AF94">>}, + {<<"worker_pool">>, <<"BD98A0BE1D20057AE9967CBE73D263AEA5BE14BBE4C73CAFEB1378572FF14561">>}]}, {pkg_hash_ext,[ - {<<"amoc">>, <<"66A377798F9F4F6361C223A586FEB32CA6B3401FA106850C9D9682FEB3BBD5B9">>}, + {<<"amoc">>, <<"B8DD4F77BB94716ABC64E863158EEF8E1375CECB2F69E57DC4A293B0949D4985">>}, {<<"base16">>, <<"06EA2D48343282E712160BA89F692B471DB8B36ABE8394F3445FF9032251D772">>}, {<<"bbmustache">>, <<"688B33A4D5CC2D51F575ADF0B3683FC40A38314A2F150906EDCFC77F5B577B3B">>}, {<<"bear">>, <<"157B67901ADF84FF0DA6EAE035CA1292A0AC18AA55148154D8C582B2C68959DB">>}, - {<<"cowboy">>, <<"2C729F934B4E1AA149AFF882F57C6372C15399A20D54F65C8D67BEF583021BDE">>}, - {<<"cowlib">>, <<"2B3E9DA0B21C4565751A6D4901C20D1B4CC25CBB7FD50D91D2AB6DD287BC86A9">>}, + {<<"cowboy">>, <<"8A7ABE6D183372CEB21CAA2709BEC928AB2B72E18A3911AA1771639BEF82651E">>}, + {<<"cowlib">>, <<"163B73F6367A7341B33C794C4E88E7DBFE6498AC42DCD69EF44C5BC5507C8DB0">>}, {<<"docsh">>, <<"4E7DB461BB07540D2BC3D366B8513F0197712D0495BB85744F367D3815076134">>}, - {<<"escalus">>, <<"05614337F7CC4383EC73C036CD2C6D3B9A87E86A5D1EE82F160736188F460675">>}, - {<<"exml">>, <<"D7D104FAE002FBB9B2096B4F9640073A89DF440CACB17ED87E45FCEEF7D8544F">>}, - {<<"fast_pbkdf2">>, <<"2900431E2E6402F23A92754448BBD949DA366BC9C984FDC791DDCFCC41042434">>}, - {<<"fast_scram">>, <<"4B30084E3BDB39158076381FC871035BEFD157D5EE614BDA5E19EA482855E5D5">>}, - {<<"fast_tls">>, <<"D1F422AF40C7777FE534496F508EE86515CB929AD10F7D1D56AA94CE899B44A0">>}, + {<<"escalus">>, <<"048CEB922E64F23DD05890A60256EDC28B86969E48B0BE5FDE202F62315C9E4F">>}, + {<<"exml">>, <<"D8E7894E2544402B4986EEB2443C15B51B14F686266F091DBF2777D1D99A2FA2">>}, + {<<"fast_pbkdf2">>, <<"BC3B5A3CAB47AD114FF8BB815FEDE62A6187ACD14D8B37412F2AF8236A089CEF">>}, + {<<"fast_scram">>, <<"771D034341599CFC6A6C5E56CF924B68D2C7478088CAF17419E3147B66914667">>}, + {<<"fast_tls">>, <<"131542913937025E48CD80AA81F00359686D5501B75621E72026A87B5229505B">>}, {<<"fusco">>, <<"6343551BD1E824F2A6CA85E1158C5B37C320FD449FBFEC7450A73F192AAF9022">>}, {<<"getopt">>, <<"53E1AB83B9CEB65C9672D3E7A35B8092E9BDC9B3EE80721471A161C10C59959C">>}, - {<<"gun">>, <<"6B9D1EAE146410D727140DBF8B404B9631302ECC2066D1D12F22097AD7D254FC">>}, - {<<"jesse">>, <<"3F9475B0C5B242E09592604AABB03328501D7E3D8A528173B5A75396EEDB0060">>}, - {<<"jiffy">>, <<"62E1F0581C3C19C33A725C781DFA88410D8BFF1BBAFC3885A2552286B4785C4C">>}, + {<<"gun">>, <<"A10BC8D6096B9502205022334F719CC9A08D9ADCFBFC0DBEE9EF31B56274A20B">>}, + {<<"jesse">>, <<"860EF4621DDBFB72792668929BE127E45E8B07CF19EEA264B0A9D48D36CCA41B">>}, + {<<"jiffy">>, <<"BB61BC42A720BBD33CB09A410E48BB79A61012C74CB8B3E75F26D988485CF381">>}, {<<"jsx">>, <<"0C5CC8FDC11B53CC25CF65AC6705AD39E54ECC56D1C22E4ADB8F5A53FB9427F3">>}, {<<"meck">>, <<"81344F561357DC40A8344AFA53767C32669153355B626EA9FCBC8DA6B3045826">>}, - {<<"p1_utils">>, <<"47F21618694EEEE5006AF1C88731AD86B757161E7823C29B6F73921B571C8502">>}, + {<<"p1_utils">>, <<"D0379E8C1156B98BD64F8129C1DE022FCCA4F2FDB7486CE73BF0ED2C3376B04C">>}, {<<"parse_trans">>, <<"F99E368830BEA44552224E37E04943A54874F08B8590485DE8D13832B63A2DC3">>}, {<<"providers">>, <<"E45745ADE9C476A9A469EA0840E418AB19360DC44F01A233304E118A44486BA0">>}, - {<<"quickrand">>, <<"252CF0493570EBF1A58985CB71990982CDDCD4396B6427F1E10CF58924C1C052">>}, - {<<"ranch">>, <<"49FBCFD3682FAB1F5D109351B61257676DA1A2FDBE295904176D5E521A2DDFE5">>}, + {<<"quickrand">>, <<"B8ACBF89A224BC217C3070CA8BEBC6EB236DBE7F9767993B274084EA044D35F0">>}, + {<<"ranch">>, <<"244EE3FA2A6175270D8E1FC59024FD9DBC76294A321057DE8F803B1479E76916">>}, {<<"rfc3339">>, <<"182314DE35C9F4180B22EB5F22916D8D7A799C1109A060C752970273A9332AD6">>}, {<<"telemetry">>, <<"DAD9CE9D8EFFC621708F99EAC538EF1CBE05D6A874DD741DE2E689C47FEAFED5">>}, - {<<"uuid">>, <<"E54373262CA88401689277947C54B95E9ECBC977BD5C57C9DD44AD9DA278E360">>}, - {<<"worker_pool">>, <<"F9D95B85E80C5C27B7AB2E60BF780DA70A5E26DD9E6D30BE45032742FC039CC5">>}]} + {<<"uuid">>, <<"4E4C5CA3461DC47C5E157ED42AA3981A053B7A186792AF972A27B14A9489324E">>}, + {<<"worker_pool">>, <<"64E560DE08CA5E7DB8BD4CDCC7B744B0659696194E3BC9E56239BA4A0F7E24F9">>}]} ]. diff --git a/src/scenarios/gdpr_removal.erl b/src/scenarios/gdpr_removal.erl index 4268925..5111c27 100644 --- a/src/scenarios/gdpr_removal.erl +++ b/src/scenarios/gdpr_removal.erl @@ -332,7 +332,7 @@ start_user(Client) -> user_loop(Client, #{Id=>{new, TS}}). create_new_node(Client) -> - amoc_throttle:send_and_wait(?NODE_CREATION_THROTTLING, create_node), + amoc_throttle:wait(?NODE_CREATION_THROTTLING), create_pubsub_node(Client). user_loop(Client, Requests) -> @@ -494,7 +494,7 @@ caps() -> %% Room creation %%------------------------------------------------------------------------------------------------ request_muc_light_room(Client) -> - amoc_throttle:send_and_wait(?ROOM_CREATION_THROTTLING, create_room), + amoc_throttle:wait(?ROOM_CREATION_THROTTLING), Id = ?ROOM_CREATION_ID, MucHost = amoc_config:get(muc_host), CreateRoomStanza = escalus_stanza:iq_set(?NS_MUC_LIGHT_CREATION, []), diff --git a/src/scenarios/pubsub_pep.erl b/src/scenarios/pubsub_pep.erl index 636c7ea..69f2bce 100644 --- a/src/scenarios/pubsub_pep.erl +++ b/src/scenarios/pubsub_pep.erl @@ -178,7 +178,7 @@ start_user(Client) -> user_loop(Client). create_new_node(Client) -> - amoc_throttle:send_and_wait(?NODE_CREATION_THROTTLING, create_node), + amoc_throttle:wait(?NODE_CREATION_THROTTLING), create_pubsub_node(Client), amoc_coordinator:add(?MODULE, Client). diff --git a/src/scenarios/pubsub_simple.erl b/src/scenarios/pubsub_simple.erl index 9cef070..b85d24e 100644 --- a/src/scenarios/pubsub_simple.erl +++ b/src/scenarios/pubsub_simple.erl @@ -209,7 +209,7 @@ start_user(Client) -> user_loop(Client, Node, #{}). create_new_node(Client) -> - amoc_throttle:send_and_wait(?NODE_CREATION_THROTTLING, create_node), + amoc_throttle:wait(?NODE_CREATION_THROTTLING), Node = create_pubsub_node(Client), amoc_coordinator:add(?MODULE, {Client, Node}), Node. From 371b70d24b2e7a13ee5b981a7f1616a15442564e Mon Sep 17 00:00:00 2001 From: Nelson Vides Date: Thu, 22 Aug 2024 11:55:57 +0200 Subject: [PATCH 2/2] Fix dialyzer --- rebar.config | 4 +-- rebar.lock | 6 ++-- src/amoc_always_null_ssl_session_cache.erl | 4 +-- src/scenarios/gdpr_removal.erl | 33 ++++++++++++--------- src/scenarios/mongoose_mam.erl | 8 ++--- src/scenarios/pubsub_pep.erl | 29 +++++++++++------- src/scenarios/pubsub_simple.erl | 34 ++++++++++++---------- 7 files changed, 67 insertions(+), 51 deletions(-) diff --git a/rebar.config b/rebar.config index 490000a..89da0c1 100644 --- a/rebar.config +++ b/rebar.config @@ -4,7 +4,7 @@ { deps, [ {amoc_arsenal, {git, "https://github.com/esl/amoc-arsenal.git", {branch, "main"}}}, - {escalus, "4.2.15"}, + {escalus, "4.2.16"}, {jiffy, "1.1.2"}, {fusco, "0.1.1"} ]}. @@ -16,7 +16,7 @@ ]}. { dialyzer, [ - {plt_extra_apps, [amoc]} + {plt_extra_apps, [stdlib, exml, amoc, escalus, fusco, gun]} ]}. { relx, [ diff --git a/rebar.lock b/rebar.lock index 89f0956..de06d9b 100644 --- a/rebar.lock +++ b/rebar.lock @@ -14,7 +14,7 @@ {<<"cowboy">>,{pkg,<<"cowboy">>,<<"2.12.0">>},2}, {<<"cowlib">>,{pkg,<<"cowlib">>,<<"2.12.1">>},2}, {<<"docsh">>,{pkg,<<"docsh">>,<<"0.7.2">>},1}, - {<<"escalus">>,{pkg,<<"escalus">>,<<"4.2.15">>},0}, + {<<"escalus">>,{pkg,<<"escalus">>,<<"4.2.16">>},0}, {<<"exml">>,{pkg,<<"hexml">>,<<"3.4.1">>},1}, {<<"exometer_core">>, {git,"https://github.com/esl/exometer_core.git", @@ -52,7 +52,7 @@ {<<"cowboy">>, <<"F276D521A1FF88B2B9B4C54D0E753DA6C66DD7BE6C9FCA3D9418B561828A3731">>}, {<<"cowlib">>, <<"A9FA9A625F1D2025FE6B462CB865881329B5CAFF8F1854D1CBC9F9533F00E1E1">>}, {<<"docsh">>, <<"F893D5317A0E14269DD7FE79CF95FB6B9BA23513DA0480EC6E77C73221CAE4F2">>}, - {<<"escalus">>, <<"1F153CFBEAA67B012F7A34D0AD61A8CD68ED7C0BF9F02B94606B339FBCDCD617">>}, + {<<"escalus">>, <<"EC83C277DECD721C3B219823C159D66CF94981A0796473617E4C0835E7395FE5">>}, {<<"exml">>, <<"9581FE6512D9772C61BBE611CD4A8E5BB90B4D4481275325EC520F7A931A9393">>}, {<<"fast_pbkdf2">>, <<"6045138C4C209FC8222A0B18B2CB1D7BD7407EF4ADAD0F14C5E0F7F4726E3E41">>}, {<<"fast_scram">>, <<"70724F584A118DA147A51EE38DEE56203F217D58AD61E0BB2C2EF834C16B35B8">>}, @@ -81,7 +81,7 @@ {<<"cowboy">>, <<"8A7ABE6D183372CEB21CAA2709BEC928AB2B72E18A3911AA1771639BEF82651E">>}, {<<"cowlib">>, <<"163B73F6367A7341B33C794C4E88E7DBFE6498AC42DCD69EF44C5BC5507C8DB0">>}, {<<"docsh">>, <<"4E7DB461BB07540D2BC3D366B8513F0197712D0495BB85744F367D3815076134">>}, - {<<"escalus">>, <<"048CEB922E64F23DD05890A60256EDC28B86969E48B0BE5FDE202F62315C9E4F">>}, + {<<"escalus">>, <<"3CA9D58F39A3FBD618A1E7B5D57AE97B76016330BB2374C430AA9278669243CC">>}, {<<"exml">>, <<"D8E7894E2544402B4986EEB2443C15B51B14F686266F091DBF2777D1D99A2FA2">>}, {<<"fast_pbkdf2">>, <<"BC3B5A3CAB47AD114FF8BB815FEDE62A6187ACD14D8B37412F2AF8236A089CEF">>}, {<<"fast_scram">>, <<"771D034341599CFC6A6C5E56CF924B68D2C7478088CAF17419E3147B66914667">>}, diff --git a/src/amoc_always_null_ssl_session_cache.erl b/src/amoc_always_null_ssl_session_cache.erl index 45332f5..f041ca9 100644 --- a/src/amoc_always_null_ssl_session_cache.erl +++ b/src/amoc_always_null_ssl_session_cache.erl @@ -38,5 +38,5 @@ foldl(_, Acc, _) -> Acc. -spec select_session(db_handle(), tuple() | inet:port_number()) -> []. select_session(_, _) -> []. --spec size(db_handle()) -> integer(). -size(_) -> 0. +-spec size(db_handle()) -> pos_integer(). +size(_) -> 1. diff --git a/src/scenarios/gdpr_removal.erl b/src/scenarios/gdpr_removal.erl index 5111c27..53006c8 100644 --- a/src/scenarios/gdpr_removal.erl +++ b/src/scenarios/gdpr_removal.erl @@ -448,26 +448,31 @@ create_pubsub_node(Client) -> Request = publish_pubsub_stanza(Client, ReqId, #xmlel{name = <<"nothing">>}), escalus:send(Client, Request), - {CreateNodeTime, CreateNodeResult} = timer:tc( - fun() -> - catch escalus:wait_for_stanza(Client, amoc_config:get(iq_timeout)) - end), - - case {escalus_pred:is_iq_result(Request, CreateNodeResult), CreateNodeResult} of - {true, _} -> - ?LOG_DEBUG("node creation ~p (~p)", [?NODE, self()]), - amoc_metrics:update_counter(node_creation_success), - amoc_metrics:update_time(node_creation, CreateNodeTime); - {false, {'EXIT', {timeout_when_waiting_for_stanza, _}}} -> + try + Fun = fun() -> escalus:wait_for_stanza(Client, amoc_config:get(iq_timeout)) end, + {CreateNodeTime, CreateNodeResult} = timer:tc(Fun), + case escalus_pred:is_iq_result(Request, CreateNodeResult) of + true -> + ?LOG_DEBUG("node creation ~p (~p)", [?NODE, self()]), + amoc_metrics:update_counter(node_creation_success), + amoc_metrics:update_time(node_creation, CreateNodeTime); + false -> + amoc_metrics:update_counter(node_creation_failure), + ?LOG_ERROR("Error creating node: ~p", [CreateNodeResult]), + exit(node_creation_failed) + end + catch + exit:{timeout_when_waiting_for_stanza, _} = Exit -> amoc_metrics:update_counter(node_creation_timeout), - ?LOG_ERROR("Timeout creating node: ~p", [CreateNodeResult]), + ?LOG_ERROR("Timeout creating node: ~p", [Exit]), exit(node_creation_timeout); - {false, _} -> + Error:Reason -> amoc_metrics:update_counter(node_creation_failure), - ?LOG_ERROR("Error creating node: ~p", [CreateNodeResult]), + ?LOG_ERROR("Error creating node: ~p", [{Error, Reason}]), exit(node_creation_failed) end. + %%------------------------------------------------------------------------------------------------ %% User presence & caps %%------------------------------------------------------------------------------------------------ diff --git a/src/scenarios/mongoose_mam.erl b/src/scenarios/mongoose_mam.erl index 1166080..cd08d42 100644 --- a/src/scenarios/mongoose_mam.erl +++ b/src/scenarios/mongoose_mam.erl @@ -203,7 +203,7 @@ send_and_recv_escalus_handlers() -> -spec read_messages_from_archive_since_timestamp( Client :: escalus:client(), Timestamp :: erlang:timestamp(), - Timeout :: timer:time() + Timeout :: non_neg_integer() ) -> any(). read_messages_from_archive_since_timestamp(Client, Timestamp, Timeout) -> case catch do_read_messages_from_archive_since_timestamp(Client, @@ -223,7 +223,7 @@ read_messages_from_archive_since_timestamp(Client, Timestamp, Timeout) -> -spec do_read_messages_from_archive_since_timestamp( Client :: escalus:client(), Timestamp :: erlang:timestamp(), - Timeout :: timer:time() + Timeout :: non_neg_integer() ) -> ResponseTimeMicroseconds :: integer() | no_return(). % escalus throws an exception after Timeout do_read_messages_from_archive_since_timestamp(Client, Timestamp, Timeout) -> @@ -239,7 +239,7 @@ do_read_messages_from_archive_since_timestamp(Client, Timestamp, Timeout) -> -spec receive_mam_messages_until_end( Client :: escalus_connection:client(), - Timeout :: timer:time()) -> ok | no_return(). + Timeout :: non_neg_integer()) -> ok | no_return(). receive_mam_messages_until_end(Client, Timeout) -> Stanza = escalus_connection:get_stanza(Client, mam_message_timeout, Timeout), ?LOG_DEBUG("Stanza = ~p", [Stanza]), @@ -254,7 +254,7 @@ receive_mam_messages_until_end(Client, Timeout) -> -spec maybe_mam_fin_message( Stanza :: exml:element(), Client :: escalus_connection:client(), - Timeout :: timer:time()) -> ok | no_return(). + Timeout :: non_neg_integer()) -> ok | no_return(). maybe_mam_fin_message(Stanza, Client, Timeout) -> case is_mam_fin_complete_message(Stanza) of true -> diff --git a/src/scenarios/pubsub_pep.erl b/src/scenarios/pubsub_pep.erl index 69f2bce..61b42a5 100644 --- a/src/scenarios/pubsub_pep.erl +++ b/src/scenarios/pubsub_pep.erl @@ -234,19 +234,26 @@ create_pubsub_node(Client) -> %Request = escalus_pubsub_stanza:create_node(Client, ReqId, ?NODE), escalus:send(Client, Request), - CreateNodeResult = (catch escalus:wait_for_stanza(Client, amoc_config:get(iq_timeout))), - - case {escalus_pred:is_iq_result(Request, CreateNodeResult), CreateNodeResult} of - {true, _} -> - ?LOG_DEBUG("node creation ~p (~p)", [?NODE, self()]), - iq_metrics:response(ReqId, result); - {false, {'EXIT', {timeout_when_waiting_for_stanza, _}}} -> + try + CreateNodeResult = escalus:wait_for_stanza(Client, amoc_config:get(iq_timeout)), + case escalus_pred:is_iq_result(Request, CreateNodeResult) of + true -> + ?LOG_DEBUG("node creation ~p (~p)", [?NODE, self()]), + iq_metrics:response(ReqId, result); + false -> + iq_metrics:response(ReqId, error), + ?LOG_ERROR("Error creating node: ~p", [CreateNodeResult]), + exit(node_creation_failed) + end + + catch + exit:{timeout_when_waiting_for_stanza, _} = Exit -> iq_metrics:timeout(ReqId, delete), - ?LOG_ERROR("Timeout creating node: ~p", [CreateNodeResult]), + ?LOG_ERROR("Timeout creating node: ~p", [Exit]), exit(node_creation_timeout); - {false, _} -> - iq_metrics:response(ReqId, error), - ?LOG_ERROR("Error creating node: ~p", [CreateNodeResult]), + Error:Reason -> + amoc_metrics:update_counter(node_creation_failure), + ?LOG_ERROR("Error creating node: ~p", [{Error, Reason}]), exit(node_creation_failed) end. diff --git a/src/scenarios/pubsub_simple.erl b/src/scenarios/pubsub_simple.erl index b85d24e..053353f 100644 --- a/src/scenarios/pubsub_simple.erl +++ b/src/scenarios/pubsub_simple.erl @@ -291,23 +291,27 @@ create_pubsub_node(Client) -> Request = escalus_pubsub_stanza:create_node(Client, ReqId, Node, NodeConfig), escalus:send(Client, Request), - {CreateNodeTime, CreateNodeResult} = timer:tc( - fun() -> - catch escalus:wait_for_stanza(Client, amoc_config:get(iq_timeout)) - end), - - case {escalus_pred:is_iq_result(Request, CreateNodeResult), CreateNodeResult} of - {true, _} -> - ?LOG_DEBUG("node creation ~p (~p)", [Node, self()]), - amoc_metrics:update_counter(node_creation_success, 1), - amoc_metrics:update_time(node_creation, CreateNodeTime); - {false, {'EXIT', {timeout_when_waiting_for_stanza, _}}} -> + try + Fun = fun() -> escalus:wait_for_stanza(Client, amoc_config:get(iq_timeout)) end, + {CreateNodeTime, CreateNodeResult} = timer:tc(Fun), + case escalus_pred:is_iq_result(Request, CreateNodeResult) of + true -> + ?LOG_DEBUG("node creation ~p (~p)", [Node, self()]), + amoc_metrics:update_counter(node_creation_success, 1), + amoc_metrics:update_time(node_creation, CreateNodeTime); + false -> + amoc_metrics:update_counter(node_creation_failure, 1), + ?LOG_ERROR("Error creating node: ~p", [CreateNodeResult]), + exit(node_creation_failed) + end + catch + exit:{timeout_when_waiting_for_stanza, _} = Exit -> amoc_metrics:update_counter(node_creation_timeout, 1), - ?LOG_ERROR("Timeout creating node: ~p", [CreateNodeResult]), + ?LOG_ERROR("Timeout creating node: ~p", [Exit]), exit(node_creation_timeout); - {false, _} -> - amoc_metrics:update_counter(node_creation_failure, 1), - ?LOG_ERROR("Error creating node: ~p", [CreateNodeResult]), + Error:Reason -> + amoc_metrics:update_counter(node_creation_failure), + ?LOG_ERROR("Error creating node: ~p", [{Error, Reason}]), exit(node_creation_failed) end, Node.