Skip to content

Commit 5dc66c5

Browse files
committed
test: accept prompts change notifications in watch tests
Signed-off-by: Rohit Patil <ropatil@redhat.com>
1 parent 8302c9f commit 5dc66c5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkg/mcp/mcp_watch_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ func (s *WatchKubeConfigSuite) TestNotifiesToolsChangeMultipleTimes() {
5858
notification := s.WaitForNotification(5 * time.Second)
5959
// Then
6060
s.NotNil(notification, "WatchKubeConfig did not notify on iteration %d", i)
61-
s.Equalf("notifications/tools/list_changed", notification.Method, "WatchKubeConfig did not notify tools change on iteration %d", i)
61+
s.True(
62+
notification.Method == "notifications/tools/list_changed" || notification.Method == "notifications/prompts/list_changed",
63+
"WatchKubeConfig did not notify tools or prompts change on iteration %d, got: %s", i, notification.Method,
64+
)
6265
}
6366
}
6467

@@ -154,7 +157,10 @@ func (s *WatchClusterStateSuite) TestNotifiesToolsChangeMultipleTimes() {
154157
s.AddAPIGroup(`{"name":"` + name + `.example.com","versions":[{"groupVersion":"` + name + `.example.com/v1","version":"v1"}],"preferredVersion":{"groupVersion":"` + name + `.example.com/v1","version":"v1"}}`)
155158
notification := s.WaitForNotification(10 * time.Second)
156159
s.NotNil(notification, "cluster state watcher did not notify on iteration %d", i)
157-
s.Equalf("notifications/tools/list_changed", notification.Method, "cluster state watcher did not notify tools change on iteration %d", i)
160+
s.True(
161+
notification.Method == "notifications/tools/list_changed" || notification.Method == "notifications/prompts/list_changed",
162+
"cluster state watcher did not notify tools or prompts change on iteration %d, got: %s", i, notification.Method,
163+
)
158164
}
159165
}
160166

0 commit comments

Comments
 (0)