From: Christian Heller Date: Thu, 6 Nov 2025 01:06:50 +0000 (+0100) Subject: Clean up unwieldy-grown timeout test. X-Git-Url: https://plomlompom.com/repos/new_day?a=commitdiff_plain;h=37ff0956cc9a8aff57e872fa8803bc343c4dc824;p=ircplom Clean up unwieldy-grown timeout test. --- diff --git a/src/tests/_timeout_retries.test b/src/tests/_timeout_retries.test index 19f09e7..be14b59 100644 --- a/src/tests/_timeout_retries.test +++ b/src/tests/_timeout_retries.test @@ -11,44 +11,27 @@ log 1 $ users cleared log 1 $ channels cleared log , $ DISCONNECTED -× conn-retry -log 1 $ connection_state set to: [connecting] -log 2 $ attempting connection to foo.bar.baz:10003 identifying with … +× identifiers log 2 $ - nickname: foo log 2 $ - realname: baz log 2 $ - username: foobarbazquux log 2 $ - password: bar -log 1 $ port set to: [10002] + +× connecting +log 1 $ connection_state set to: [connecting] + +× fake-testing-timeout log 1 $ connection_state set to: [failed to connect: FAKE TESTING TIMEOUT] -× conn-init-retries +× conns-init log 1 $ port set to: [10003] log 1 $ nick_wanted set to: [foo] log 1 $ user_wanted set to: [foobarbazquux] log 1 $ realname set to: [baz] log 1 $ password set to: [bar] -insert conn-retry : +1 -log 1 $ will retry connecting in 1 seconds -insert conn-retry :1 +1 -log 2 $ attempting connection to foo.bar.baz:10002 identifying with … -insert conn-retry 2:6 +2 -log 1 $ port set to: [10001] -insert conn-retry 7: +1 -log 1 $ will retry connecting in 2 seconds -insert conn-retry :1 +1 -log 2 $ attempting connection to foo.bar.baz:10001 identifying with … -insert conn-retry 2:6 +2 -log 1 $ port set to: [10000] -insert conn-retry 7: +1 -log 1 $ will retry connecting in 4 seconds × conn -log 1 $ connection_state set to: [connecting] -log 2 $ attempting connection to foo.bar.baz:10000 identifying with … -log 2 $ - nickname: foo -log 2 $ - realname: baz -log 2 $ - username: foobarbazquux -log 2 $ - password: bar +insert identifiers : +2 log 1 $ connection_state set to: [connected] log 2 $ CONNECTED log 1 > CAP LS :302 @@ -61,12 +44,35 @@ log 1 > NICK :foo # the TestingClient meanwhile will decrement any port of that range by 1 after # each started connection attempt > /connect foo.bar.baz:10003 foo:bar baz:foobarbazquux - insert clientwin-init log 1 $ hostname set to: [foo.bar.baz] -insert conn-init-retries +insert conns-init -# with TestingClient finally having reduced port to 10000, connecting works now +# check increase of retry waits +insert connecting : +1 +log 2 $ attempting connection to foo.bar.baz:10003 identifying with … +insert identifiers : +2 +log 1 $ port set to: [10002] +insert fake-testing-timeout +log 1 $ will retry connecting in 1 seconds +# +insert connecting : +1 +log 2 $ attempting connection to foo.bar.baz:10002 identifying with … +insert identifiers : +2 +log 1 $ port set to: [10001] +insert fake-testing-timeout +log 1 $ will retry connecting in 2 seconds +# +insert connecting : +1 +log 2 $ attempting connection to foo.bar.baz:10001 identifying with … +insert identifiers : +2 +log 1 $ port set to: [10000] +insert fake-testing-timeout +log 1 $ will retry connecting in 4 seconds + +# check connecting works with TestingClient port finally reduced to 10000 +insert connecting +log 2 $ attempting connection to foo.bar.baz:10000 identifying with … insert conn # check retry chain also started by in-connection timeout @@ -86,30 +92,28 @@ log 1 $ will retry connecting in 1 seconds log 1 $ already disconnected, stopped connecting attempts wait 1 -# on second server, check timed auto-retries don't activate after manual intervention -> /connect baz.bar.foo:10003 foo:bar baz:foobarbazquux +# connect to second server to check timed auto-retries don't activate after manual intervention +> /connect baz.bar.foo:10001 foo:bar baz:foobarbazquux insert clientwin-init : +3 log 3 $ hostname set to: [baz.bar.foo] -insert conn-init-retries :5 +3 -insert conn-retry :1 +3 -log 4 $ attempting connection to baz.bar.foo:10003 identifying with … -insert conn-retry 2: +3 -insert conn-init-retries 6:8 +3 -log 4 $ attempting connection to baz.bar.foo:10002 identifying with … -insert conn-retry 2:6 +4 log 3 $ port set to: [10001] -insert conn-retry 7: +3 -insert conn-init-retries 12:14 +3 +insert conns-init 1: +3 +insert connecting : +3 log 4 $ attempting connection to baz.bar.foo:10001 identifying with … -insert conn-retry 2:6 +4 +insert identifiers : +4 log 3 $ port set to: [10000] -insert conn-init-retries 17:20 +3 +insert fake-testing-timeout : +3 +log 3 $ will retry connecting in 1 seconds + +# during retry-wait /reconnect, then wait announced duration to check nothing else happens > /window 3 > /reconnect -insert conn :1 +3 +insert connecting : +3 log 4 $ attempting connection to baz.bar.foo:10000 identifying with … -insert conn 2: +3 -wait 4 +insert conn : +3 +wait 1 + +# same way ensure retry chain wasn't solely blocked by being connected > /disconnect log 3 > QUIT :ircplom says bye -wait 4 +wait 1