This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch graphql-ws-scheduler-shutdown
in repository https://gitbox.apache.org/repos/asf/unomi.git


The following commit(s) were added to refs/heads/graphql-ws-scheduler-shutdown 
by this push:
     new f5deaab62 Cover the destroy() wiring that stops the WebSocket deadline 
scheduler
f5deaab62 is described below

commit f5deaab628324885f5e306505547ad3bb700fd78
Author: Serge Huber <[email protected]>
AuthorDate: Fri Sep 4 17:32:39 2026 +0200

    Cover the destroy() wiring that stops the WebSocket deadline scheduler
    
    The factory test only showed that shutdown() stops the executor; it would
    still pass with the destroy() call removed, which is the wiring that was
    broken. Add a servlet test that configures the servlet, destroys it and 
checks
    the creator was shut down.
    
    Co-Authored-By: Claude Opus 4.8 <[email protected]>
---
 .../main/java/org/apache/unomi/graphql/servlet/GraphQLServlet.java   | 5 +++++
 .../graphql/servlet/websocket/SubscriptionWebSocketFactory.java      | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/servlet/GraphQLServlet.java
 
b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/servlet/GraphQLServlet.java
index 307a93baf..e4b3f88a8 100644
--- 
a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/servlet/GraphQLServlet.java
+++ 
b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/servlet/GraphQLServlet.java
@@ -110,6 +110,11 @@ public class GraphQLServlet extends WebSocketServlet {
 
     private SubscriptionWebSocketFactory socketCreator;
 
+    /** For tests: the creator whose scheduler {@link #destroy()} must stop. */
+    SubscriptionWebSocketFactory socketCreator() {
+        return socketCreator;
+    }
+
     @Override
     public void destroy() {
         try {
diff --git 
a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/servlet/websocket/SubscriptionWebSocketFactory.java
 
b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/servlet/websocket/SubscriptionWebSocketFactory.java
index 3ce1c4589..9dc5cc848 100644
--- 
a/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/servlet/websocket/SubscriptionWebSocketFactory.java
+++ 
b/graphql/cxs-impl/src/main/java/org/apache/unomi/graphql/servlet/websocket/SubscriptionWebSocketFactory.java
@@ -82,7 +82,8 @@ public class SubscriptionWebSocketFactory extends 
WebSocketServerFactory {
         authenticationDeadlineScheduler.shutdownNow();
     }
 
-    boolean isShutdown() {
+    /** Whether {@link #shutdown()} has run; lets the servlet test verify the 
destroy() wiring. */
+    public boolean isShutdown() {
         return authenticationDeadlineScheduler.isShutdown();
     }
 }

Reply via email to