From 0d2c013edcf33cfbf806d77ac6cd0dec17fe9a72 Mon Sep 17 00:00:00 2001 From: endigma Date: Mon, 6 Oct 2025 13:21:53 +0100 Subject: [PATCH 1/4] chore: use wip go-tools db9227f7 --- router-tests/go.mod | 2 +- router-tests/go.sum | 4 ++-- router/go.mod | 2 +- router/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/router-tests/go.mod b/router-tests/go.mod index b49dec69d0..7af49d38a6 100644 --- a/router-tests/go.mod +++ b/router-tests/go.mod @@ -27,7 +27,7 @@ require ( github.com/wundergraph/cosmo/demo/pkg/subgraphs/projects v0.0.0-20250715110703-10f2e5f9c79e github.com/wundergraph/cosmo/router v0.0.0-20250912064154-106e871ee32e github.com/wundergraph/cosmo/router-plugin v0.0.0-20250808194725-de123ba1c65e - github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.229 + github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.229.0.20251006122017-db9227f78c03 go.opentelemetry.io/otel v1.36.0 go.opentelemetry.io/otel/sdk v1.36.0 go.opentelemetry.io/otel/sdk/metric v1.36.0 diff --git a/router-tests/go.sum b/router-tests/go.sum index 65eaff9693..7c37b19eb1 100644 --- a/router-tests/go.sum +++ b/router-tests/go.sum @@ -352,8 +352,8 @@ github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083 h1:8/D7f8gKxTB github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083/go.mod h1:eOTL6acwctsN4F3b7YE+eE2t8zcJ/doLm9sZzsxxxrE= github.com/wundergraph/consul/sdk v0.0.0-20250204115147-ed842a8fd301 h1:EzfKHQoTjFDDcgaECCCR2aTePqMu9QBmPbyhqIYOhV0= github.com/wundergraph/consul/sdk v0.0.0-20250204115147-ed842a8fd301/go.mod h1:wxI0Nak5dI5RvJuzGyiEK4nZj0O9X+Aw6U0tC1wPKq0= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.229 h1:VCfCX/xmpBGQLhTHJMHLugzJrXJk/smjLRAEruCI0HY= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.229/go.mod h1:g1IFIylu5Fd9pKjzq0mDvpaKhEB/vkwLAIbGdX2djXU= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.229.0.20251006122017-db9227f78c03 h1:M+mypz5oeCwe/gq5qjvaXbSyS7WoAQP6XIU/TEPGB4Q= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.229.0.20251006122017-db9227f78c03/go.mod h1:g1IFIylu5Fd9pKjzq0mDvpaKhEB/vkwLAIbGdX2djXU= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4= github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= diff --git a/router/go.mod b/router/go.mod index 3bf34dfab4..64b2e88dd0 100644 --- a/router/go.mod +++ b/router/go.mod @@ -31,7 +31,7 @@ require ( github.com/tidwall/gjson v1.18.0 github.com/tidwall/sjson v1.2.5 github.com/twmb/franz-go v1.16.1 - github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.229 + github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.229.0.20251006122017-db9227f78c03 // Do not upgrade, it renames attributes we rely on go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 go.opentelemetry.io/contrib/propagators/b3 v1.23.0 diff --git a/router/go.sum b/router/go.sum index 0bcf0aa4f0..b974274c7d 100644 --- a/router/go.sum +++ b/router/go.sum @@ -321,8 +321,8 @@ github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/ github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083 h1:8/D7f8gKxTBjW+SZK4mhxTTBVpxcqeBgWF1Rfmltbfk= github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083/go.mod h1:eOTL6acwctsN4F3b7YE+eE2t8zcJ/doLm9sZzsxxxrE= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.229 h1:VCfCX/xmpBGQLhTHJMHLugzJrXJk/smjLRAEruCI0HY= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.229/go.mod h1:g1IFIylu5Fd9pKjzq0mDvpaKhEB/vkwLAIbGdX2djXU= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.229.0.20251006122017-db9227f78c03 h1:M+mypz5oeCwe/gq5qjvaXbSyS7WoAQP6XIU/TEPGB4Q= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.229.0.20251006122017-db9227f78c03/go.mod h1:g1IFIylu5Fd9pKjzq0mDvpaKhEB/vkwLAIbGdX2djXU= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4= github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= From cf42a4d674b6c2b00dd8e5569b8eab232071237d Mon Sep 17 00:00:00 2001 From: Alessandro Pagnin Date: Tue, 21 Oct 2025 19:55:52 +0200 Subject: [PATCH 2/4] chore: update tests to not close sse connection until the end of the test --- router-tests/websocket_test.go | 42 +++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/router-tests/websocket_test.go b/router-tests/websocket_test.go index 554a005a01..7f9e05c9e6 100644 --- a/router-tests/websocket_test.go +++ b/router-tests/websocket_test.go @@ -935,6 +935,7 @@ func TestWebSockets(t *testing.T) { }, }, } + closeCh := make(chan struct{}, 1) testenv.Run(t, &testenv.Config{ ModifyEngineExecutionConfiguration: func(engineExecutionConfiguration *config.EngineExecutionConfiguration) { engineExecutionConfiguration.WebSocketClientReadTimeout = time.Millisecond * 500 @@ -972,9 +973,27 @@ func TestWebSockets(t *testing.T) { http.Error(w, "Streaming unsupported!", http.StatusInternalServerError) return } + _, err = io.WriteString(w, "event: next\n") + require.NoError(t, err) _, err = fmt.Fprintf(w, "data: %s\n\n", `{"data":{"currentTime":{"unixTime":1,"timeStamp":"2021-09-01T12:00:00Z"}}}`) require.NoError(t, err) flusher.Flush() + + ticker := time.NewTicker(50 * time.Millisecond) + defer ticker.Stop() + + for { + select { + case <-closeCh: + return + case <-r.Context().Done(): + return + case <-ticker.C: + _, err = io.WriteString(w, ":heartbeat\n\n") + require.NoError(t, err) + flusher.Flush() + } + } }) }, }, @@ -1036,8 +1055,10 @@ func TestWebSockets(t *testing.T) { } else { require.Fail(t, "expected net.Error") } + closeCh <- struct{}{} }) }) + t.Run("subscription with header propagation sse subgraph get", func(t *testing.T) { t.Parallel() @@ -1051,6 +1072,7 @@ func TestWebSockets(t *testing.T) { }, }, } + closeCh := make(chan struct{}, 1) testenv.Run(t, &testenv.Config{ ModifyEngineExecutionConfiguration: func(engineExecutionConfiguration *config.EngineExecutionConfiguration) { engineExecutionConfiguration.WebSocketClientReadTimeout = time.Millisecond * 500 @@ -1088,9 +1110,27 @@ func TestWebSockets(t *testing.T) { http.Error(w, "Streaming unsupported!", http.StatusInternalServerError) return } - _, err := fmt.Fprintf(w, "data: %s\n\n", `{"data":{"currentTime":{"unixTime":1,"timeStamp":"2021-09-01T12:00:00Z"}}}`) + _, err := io.WriteString(w, "event: next\n") + require.NoError(t, err) + _, err = fmt.Fprintf(w, "data: %s\n\n", `{"data":{"currentTime":{"unixTime":1,"timeStamp":"2021-09-01T12:00:00Z"}}}`) require.NoError(t, err) flusher.Flush() + + ticker := time.NewTicker(50 * time.Millisecond) + defer ticker.Stop() + + for { + select { + case <-closeCh: + return + case <-r.Context().Done(): + return + case <-ticker.C: + _, err = io.WriteString(w, ":heartbeat\n\n") + require.NoError(t, err) + flusher.Flush() + } + } }) }, }, From ba6f5df7d3a0eac6beeaf72acedf3ed0ad57c6fa Mon Sep 17 00:00:00 2001 From: Alessandro Pagnin Date: Tue, 21 Oct 2025 23:28:17 +0200 Subject: [PATCH 3/4] chore: remove useless closeCh --- router-tests/websocket_test.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/router-tests/websocket_test.go b/router-tests/websocket_test.go index 7f9e05c9e6..95f20f0cff 100644 --- a/router-tests/websocket_test.go +++ b/router-tests/websocket_test.go @@ -935,7 +935,7 @@ func TestWebSockets(t *testing.T) { }, }, } - closeCh := make(chan struct{}, 1) + testenv.Run(t, &testenv.Config{ ModifyEngineExecutionConfiguration: func(engineExecutionConfiguration *config.EngineExecutionConfiguration) { engineExecutionConfiguration.WebSocketClientReadTimeout = time.Millisecond * 500 @@ -984,8 +984,6 @@ func TestWebSockets(t *testing.T) { for { select { - case <-closeCh: - return case <-r.Context().Done(): return case <-ticker.C: @@ -1055,7 +1053,6 @@ func TestWebSockets(t *testing.T) { } else { require.Fail(t, "expected net.Error") } - closeCh <- struct{}{} }) }) @@ -1072,7 +1069,6 @@ func TestWebSockets(t *testing.T) { }, }, } - closeCh := make(chan struct{}, 1) testenv.Run(t, &testenv.Config{ ModifyEngineExecutionConfiguration: func(engineExecutionConfiguration *config.EngineExecutionConfiguration) { engineExecutionConfiguration.WebSocketClientReadTimeout = time.Millisecond * 500 @@ -1121,8 +1117,6 @@ func TestWebSockets(t *testing.T) { for { select { - case <-closeCh: - return case <-r.Context().Done(): return case <-ticker.C: From 047d859530235cf755af0eeae6a89658f12df6d8 Mon Sep 17 00:00:00 2001 From: Alessandro Pagnin Date: Wed, 22 Oct 2025 09:50:19 +0200 Subject: [PATCH 4/4] chore: use last release --- router-tests/go.mod | 2 +- router-tests/go.sum | 4 ++-- router/go.mod | 2 +- router/go.sum | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/router-tests/go.mod b/router-tests/go.mod index 89f0eddd9f..f6e5055412 100644 --- a/router-tests/go.mod +++ b/router-tests/go.mod @@ -27,7 +27,7 @@ require ( github.com/wundergraph/cosmo/demo/pkg/subgraphs/projects v0.0.0-20250715110703-10f2e5f9c79e github.com/wundergraph/cosmo/router v0.0.0-20250912064154-106e871ee32e github.com/wundergraph/cosmo/router-plugin v0.0.0-20250808194725-de123ba1c65e - github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.231.0.20251021175827-9765f941cc14 + github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.232 go.opentelemetry.io/otel v1.36.0 go.opentelemetry.io/otel/sdk v1.36.0 go.opentelemetry.io/otel/sdk/metric v1.36.0 diff --git a/router-tests/go.sum b/router-tests/go.sum index 261e443df8..17ca36aee1 100644 --- a/router-tests/go.sum +++ b/router-tests/go.sum @@ -354,8 +354,8 @@ github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083 h1:8/D7f8gKxTB github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083/go.mod h1:eOTL6acwctsN4F3b7YE+eE2t8zcJ/doLm9sZzsxxxrE= github.com/wundergraph/consul/sdk v0.0.0-20250204115147-ed842a8fd301 h1:EzfKHQoTjFDDcgaECCCR2aTePqMu9QBmPbyhqIYOhV0= github.com/wundergraph/consul/sdk v0.0.0-20250204115147-ed842a8fd301/go.mod h1:wxI0Nak5dI5RvJuzGyiEK4nZj0O9X+Aw6U0tC1wPKq0= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.231.0.20251021175827-9765f941cc14 h1:yBg+QJElKlmzcWssWlo3iqw3Jtben5dr/zw544WtJsY= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.231.0.20251021175827-9765f941cc14/go.mod h1:ErOQH1ki2+SZB8JjpTyGVnoBpg5picIyjvuWQJP4abg= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.232 h1:G04FDSXlEaQZS9cBrKlP8djbzquoQElB7w7i/d4sAHg= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.232/go.mod h1:ErOQH1ki2+SZB8JjpTyGVnoBpg5picIyjvuWQJP4abg= github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342 h1:FnBeRrxr7OU4VvAzt5X7s6266i6cSVkkFPS0TuXWbIg= github.com/xrash/smetrics v0.0.0-20250705151800-55b8f293f342/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= diff --git a/router/go.mod b/router/go.mod index a046bd4490..379a3a689f 100644 --- a/router/go.mod +++ b/router/go.mod @@ -31,7 +31,7 @@ require ( github.com/tidwall/gjson v1.18.0 github.com/tidwall/sjson v1.2.5 github.com/twmb/franz-go v1.16.1 - github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.231.0.20251021175827-9765f941cc14 + github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.232 // Do not upgrade, it renames attributes we rely on go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 go.opentelemetry.io/contrib/propagators/b3 v1.23.0 diff --git a/router/go.sum b/router/go.sum index 93418fdfdf..d49db3de25 100644 --- a/router/go.sum +++ b/router/go.sum @@ -322,8 +322,8 @@ github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/ github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw= github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083 h1:8/D7f8gKxTBjW+SZK4mhxTTBVpxcqeBgWF1Rfmltbfk= github.com/wundergraph/astjson v0.0.0-20250106123708-be463c97e083/go.mod h1:eOTL6acwctsN4F3b7YE+eE2t8zcJ/doLm9sZzsxxxrE= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.231.0.20251021175827-9765f941cc14 h1:yBg+QJElKlmzcWssWlo3iqw3Jtben5dr/zw544WtJsY= -github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.231.0.20251021175827-9765f941cc14/go.mod h1:ErOQH1ki2+SZB8JjpTyGVnoBpg5picIyjvuWQJP4abg= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.232 h1:G04FDSXlEaQZS9cBrKlP8djbzquoQElB7w7i/d4sAHg= +github.com/wundergraph/graphql-go-tools/v2 v2.0.0-rc.232/go.mod h1:ErOQH1ki2+SZB8JjpTyGVnoBpg5picIyjvuWQJP4abg= github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4= github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M=