Skip to content

Commit

Permalink
fixup! pytest: test connection timeout.
Browse files Browse the repository at this point in the history
  • Loading branch information
rustyrussell committed Sep 11, 2020
1 parent fd7c4c2 commit 1872983
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions connectd/connectd.c
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,7 @@ static struct io_plan *handshake_in_success(struct io_conn *conn,
/*~ If the timer goes off, we simply free everything, which hangs up. */
static void conn_timeout(struct io_conn *conn)
{
status_debug("conn timed out");
errno = ETIMEDOUT;
io_close(conn);
}
Expand Down
2 changes: 2 additions & 0 deletions tests/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2646,6 +2646,8 @@ def test_connection_timeout(node_factory):

with pytest.raises(RpcError, match='timed out'):
l1.rpc.connect(l2.info['id'], 'localhost', port=l2.port)
l1.daemon.wait_for_log('conn timed out')

with pytest.raises(RpcError, match='reset by peer'):
l2.rpc.connect(l1.info['id'], 'localhost', port=l1.port)
l1.daemon.wait_for_log('conn timed out')

0 comments on commit 1872983

Please sign in to comment.