Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E tests are failing after deploying a feature flag daemon #31152

Open
gearsdigital opened this issue Feb 21, 2025 · 1 comment
Open

E2E tests are failing after deploying a feature flag daemon #31152

gearsdigital opened this issue Feb 21, 2025 · 1 comment

Comments

@gearsdigital
Copy link

gearsdigital commented Feb 21, 2025

Current behavior

We recently deployed an OpenFeature-compliant feature flag daemon, flagd, but now all of our Cypress E2E tests are failing because the page cannot be rendered when under test. However, the application works fine when accessed manually in a browser.

No meaningful errors are given during the testrun.

Image

Environment

  • Frontend: Angular 18.2
  • Backend: Spring Boot API
  • Feature Flags: Managed by flagd, integrated via the OpenFeature Web SDK
  • Deployment: Kubernetes-based self-contained architecture
  • Feature Flag API:
curl 'https://hbp.hoermann.com/de/flags/catalog/flagd.evaluation.v1.Service/ResolveAll' \
      -X POST \
      -H 'Content-Type: application/json' \
      --data '{}'
  • Reproducibility:
    • Works: Regular browser access
    • Works: Running tests with Playwright
    • Fails: Running tests with Cypress

Would appreciate any insights or ideas on troubleshooting this further! 🚀

Further Context

  • The app can be accessed here: https://hbp.hoermann.com/de/catalog/product/H31ODDUI
  • The app has a retry mechanism if the Feature Flag WebClient can't be reached. It attempts to reconnect 5 times (1 attempt per second) before initializing without Feature Flags. You might want to increase the defaultCommandTimeout accordingly.
  • I've attached a very basic test case using the latest Cypress version to illustrate the issue.
  • I tested it with fresh installations of Cypress 13 and 14 (latest).

Test code to reproduce

I've created a simple failing test: https://github.com/gearsdigital/cypress-flagd-mre

💡 We can provide a docker image to create an isolated testing context. Just let me know!

Cypress Version

14.0.3, 13.17.0

Node version

v20.16.0

Operating System

macOS 15.3.1 (also in ci with different OS like debian or ubuntu)

Debug Logs

debug.log

Issue Details & Assumption

  • Since the app functions correctly outside of Cypress, the issue is likely Cypress-specific.
  • Given that Playwright successfully runs the tests, it suggests Cypress might be modifying the fetch API in a way that disrupts something.
  • This could be due to Cypress’s network request interception or how it handles asynchronous fetch requests.
@gearsdigital
Copy link
Author

gearsdigital commented Feb 22, 2025

It is worth noting that this is likely related to the following request:

https://hbp.hoermann.com/de/flags/catalog/flagd.evaluation.v1.Service/EventStream

As far as I can tell, this is not an HTTP request but rather something related to Protocol Buffers (ProtoBuf) or gRPC. The request mentioned above does not return anything via a GET request. It appears as a POST request in the Network tab.

If you double-click on this request in Firefox’s Network panel, you will see a stream that is regularly updated and if we block both requests within the network panel, the tests are running fine.

After further investigation, I found that the request above exposes Access-Control-Expose-Headers, which suggests that it might indeed be related to gRPC.

HTTP/2 200 
access-control-allow-origin: *
access-control-expose-headers: Accept, Accept-Encoding, Accept-Post, Connect-Accept-Encoding, Connect-Content-Encoding, Content-Encoding, Grpc-Accept-Encoding, Grpc-Encoding, Grpc-Message, Grpc-Status, Grpc-Status-Details-Bin
connect-accept-encoding: gzip
content-type: application/connect+json
date: Sat, 22 Feb 2025 10:57:32 GMT
vary: Origin

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant