Skip to content

Commit

Permalink
Increase Websocket timeouts
Browse files Browse the repository at this point in the history
(these will go away once we refactor websocket logging to support receive-based testing)
  • Loading branch information
mtrudel committed Jan 3, 2025
1 parent 66fda84 commit f9e77a3
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/bandit/websocket/protocol_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ defmodule WebSocketProtocolTest do

payload = String.duplicate("0123456789", 200_001)
SimpleWebSocketClient.send_text_frame(client, payload)
Process.sleep(100)
Process.sleep(500)
end)

assert_receive {:error, :max_frame_size_exceeded}, 500
Expand Down Expand Up @@ -321,7 +321,7 @@ defmodule WebSocketProtocolTest do
Transport.close(client)

# Wait a bit and validate that the server is closed
Process.sleep(100)
Process.sleep(500)
refute Process.alive?(pid)
end

Expand All @@ -342,7 +342,7 @@ defmodule WebSocketProtocolTest do
assert SimpleWebSocketClient.connection_closed_for_reading?(client)

# Wait a bit and validate that the server is closed
Process.sleep(100)
Process.sleep(500)
refute Process.alive?(pid)
end

Expand All @@ -366,7 +366,7 @@ defmodule WebSocketProtocolTest do
assert SimpleWebSocketClient.connection_closed_for_reading?(client)

# Wait a bit and validate that the server is closed
Process.sleep(100)
Process.sleep(500)
refute Process.alive?(pid)
end
end
Expand All @@ -389,7 +389,7 @@ defmodule WebSocketProtocolTest do

# Verify that the server didn't send any extraneous frames
assert SimpleWebSocketClient.connection_closed_for_reading?(client)
Process.sleep(100)
Process.sleep(500)
end)

assert output =~ "Received unexpected continuation frame (RFC6455§5.4)"
Expand All @@ -412,7 +412,7 @@ defmodule WebSocketProtocolTest do

# Verify that the server didn't send any extraneous frames
assert SimpleWebSocketClient.connection_closed_for_reading?(client)
Process.sleep(200)
Process.sleep(500)
end)

assert output =~ "Received unexpected text frame (RFC6455§5.4)"
Expand All @@ -436,7 +436,7 @@ defmodule WebSocketProtocolTest do

# Verify that the server didn't send any extraneous frames
assert SimpleWebSocketClient.connection_closed_for_reading?(client)
Process.sleep(100)
Process.sleep(500)
end)

assert output =~ "Received unexpected binary frame (RFC6455§5.4)"
Expand All @@ -459,7 +459,7 @@ defmodule WebSocketProtocolTest do

# Verify that the server didn't send any extraneous frames
assert SimpleWebSocketClient.connection_closed_for_reading?(client)
Process.sleep(200)
Process.sleep(500)
end)

assert output =~ "Received unexpected compressed frame (RFC6455§5.2)"
Expand All @@ -482,7 +482,7 @@ defmodule WebSocketProtocolTest do

# Verify that the server didn't send any extraneous frames
assert SimpleWebSocketClient.connection_closed_for_reading?(client)
Process.sleep(100)
Process.sleep(500)
end)

assert output =~ "Inflation error"
Expand All @@ -504,7 +504,7 @@ defmodule WebSocketProtocolTest do

# Verify that the server didn't send any extraneous frames
assert SimpleWebSocketClient.connection_closed_for_reading?(client)
Process.sleep(100)
Process.sleep(500)
end)

assert output =~ "Received non UTF-8 text frame (RFC6455§8.1)"
Expand All @@ -527,7 +527,7 @@ defmodule WebSocketProtocolTest do

# Verify that the server didn't send any extraneous frames
assert SimpleWebSocketClient.connection_closed_for_reading?(client)
Process.sleep(100)
Process.sleep(500)
end)

assert output =~ "Received non UTF-8 text frame (RFC6455§8.1)"
Expand Down

0 comments on commit f9e77a3

Please sign in to comment.