Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions test/mcp/server/transports/streamable_http_transport_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6307,10 +6307,13 @@ def string
end

test "listen keepalive is not started when the interval is nil" do
before = Thread.list.size
# The set of threads, not their count: `Thread.list` is process-wide, so a thread another test left running
# that finishes between the two samples moves the count in the direction this assertion does not care about.
# Only a thread that appears is evidence of a keepalive timer.
before = Thread.list
open_listen_stream(id: "listen-1", notifications: { toolsListChanged: true })

assert_equal before, Thread.list.size, "a nil interval must not spawn a keepalive thread"
assert_empty(Thread.list - before, "a nil interval must not spawn a keepalive thread")
end

test "listen_keepalive_interval rejects a non-positive value" do
Expand Down