Skip to content

Commit 3750972

Browse files
fix(flagd): missed error events, add e2e tests (#760)
Signed-off-by: Alexandra Oberaigner <[email protected]> Co-authored-by: Todd Baert <[email protected]>
1 parent 35e2f21 commit 3750972

File tree

5 files changed

+12
-5
lines changed

5 files changed

+12
-5
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test:
1717

1818
# call with TESTCONTAINERS_RYUK_DISABLED="true" to avoid problems with podman on Macs
1919
e2e:
20-
go clean -testcache && go list -f '{{.Dir}}/...' -m | xargs -I{} go test -timeout=1m -tags=e2e {}
20+
go clean -testcache && go list -f '{{.Dir}}/...' -m | xargs -I{} go test -timeout=2m -tags=e2e {}
2121

2222
lint:
2323
go install -v github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION)

providers/flagd/e2e/rpc_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ func TestRPCProviderE2E(t *testing.T) {
2525
"./",
2626
}
2727

28-
// Run tests with RPC-specific tags - exclude connection/event issues we won't tackle
29-
tags := "@rpc && ~@unixsocket && ~@targetURI && ~@sync && ~@metadata && ~@grace && ~@events && ~@customCert && ~@reconnect && ~@caching"
28+
// Run tests with RPC-specific tags - exclude unimplemented scenarios
29+
tags := "@rpc && ~@unixsocket && ~@targetURI && ~@sync && ~@metadata && ~@grace && ~@customCert && ~@caching"
3030

3131
if err := runner.RunGherkinTestsWithSubtests(t, featurePaths, tags); err != nil {
3232
t.Fatalf("Gherkin tests failed: %v", err)

providers/flagd/pkg/service/rpc/service.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,13 @@ func (s *Service) streamClient(ctx context.Context, streamReadySignaled *bool) e
547547
}
548548

549549
if err := stream.Err(); err != nil {
550+
s.sendEvent(ctx, of.Event{
551+
ProviderName: "flagd",
552+
EventType: of.ProviderError,
553+
ProviderEventDetails: of.ProviderEventDetails{
554+
Message: fmt.Sprintf("stream error: %s", err.Error()),
555+
},
556+
})
550557
return err
551558
}
552559

providers/flagd/spec

Submodule spec updated 38 files

0 commit comments

Comments
 (0)