home · contact · privacy
Have dedicated test script for ERROR handling.
authorChristian Heller <c.heller@plomlompom.de>
Wed, 8 Oct 2025 18:26:19 +0000 (20:26 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Wed, 8 Oct 2025 18:26:19 +0000 (20:26 +0200)
src/tests/_timeout_retries.test
src/tests/error_disconnects.test [new file with mode: 0644]

index 767029a9931930149e5c86a6b04f5a053b0b4359..c2ceebf184d206f1e63d27ea79d92658069febf3 100644 (file)
@@ -63,19 +63,6 @@ repeat isupport-clear-in isupport-clear-out
 , ..$ DISCONNECTED
 1 .!$ will retry connecting in 1 seconds
 repeat conn-full-in conn-full-out
-:0:1 ..< ERROR :Closing link: (Connection timed out)
-1 ..$ connection_state set to: [Closing link: (Connection timed out)]
-1 ..$ isupport cleared
-1 ..$ isupport:CHANTYPES set to: [#&]
-1 ..$ isupport:PREFIX set to: [(ov)@+]
-1 ..$ isupport:USERLEN set to: [10]
-1 ..$ connection_state set to: []
-wait 1
-, ..$ DISCONNECTED
-1 .!$ will retry connecting in 1 seconds
-repeat conn-full-in conn-full-out
-
-# test retry chain started by "timed out)" ERROR
 
 # on second server, check timed auto-retries don't activate after manual intervention
 > /connect baz.bar.foo:10003 foo:bar baz:foobarbazquux
diff --git a/src/tests/error_disconnects.test b/src/tests/error_disconnects.test
new file mode 100644 (file)
index 0000000..613b57d
--- /dev/null
@@ -0,0 +1,50 @@
+# to prepare first test, initiate connected state
+> /connect foo.bar.baz foo bar:baz
+| isupport-clear-in
+1 ..$ isupport cleared
+1 ..$ isupport:CHANTYPES set to: [#&]
+1 ..$ isupport:PREFIX set to: [(ov)@+]
+1 ..$ isupport:USERLEN set to: [10]
+| isupport-clear-out
+1 ..$ caps cleared
+1 ..$ users cleared
+1 ..$ channels cleared
+, ..$ DISCONNECTED
+1 ..$ hostname set to: [foo.bar.baz]
+1 ..$ port set to: [-1]
+1 ..$ nick_wanted set to: [foo]
+1 ..$ user_wanted set to: [baz]
+1 ..$ realname set to: [bar]
+1 ..$ port set to: [6697]
+| connecting-in
+1 ..$ connection_state set to: [connecting]
+1 ..$ connection_state set to: [connected]
+, ..$ CONNECTED
+1 ..> CAP LS :302
+1 ..> USER baz 0 * :bar
+1 ..> NICK :foo
+| connecting-out
+
+# test default ERROR handling
+:0:1 ..< ERROR :abc def ghi
+1 ..$ connection_state set to: [abc def ghi]
+| disconnecting-in
+repeat isupport-clear-in isupport-clear-out
+1 ..$ connection_state set to: []
+, ..$ DISCONNECTED
+| disconnecting-out
+
+# to prepare next test, get back to connected state
+> /window 1
+> /reconnect
+repeat connecting-in connecting-out
+
+# test "timed out)" ERROR handling
+:0:1 ..< ERROR :Closing link: (Connection timed out)
+1 ..$ connection_state set to: [Closing link: (Connection timed out)]
+repeat disconnecting-in disconnecting-out
+1 .!$ will retry connecting in 1 seconds
+
+# over and out
+> /quit
+0 ..<