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

Fix flaky TLS tests for GraphQL #4279

Merged
merged 4 commits into from
May 17, 2024
Merged

Commits on May 16, 2024

  1. Improve specs for the GraphQL request status in tests

    The returned data might be binary if it wasn't JSON.
    chrzaszcz committed May 16, 2024
    Configuration menu
    Copy the full SHA
    1cba184 View commit details
    Browse the repository at this point in the history

Commits on May 17, 2024

  1. Add utilities for testing TLS error handling

    The main goal is to check errors without sending the request.
    Otherwise, the errors would be unpredictable due to race conditions.
    
    For example, if there is a TLS error, and we try to send a request,
    this would sometimes succeed, and sometimes fail.
    Receiving the response could result in the 'closed' error or in a TLS error,
    depending on the timing.
    
    This is why neither of the clients (fusco, gun, httpc) can be used.
    Instead, the 'ssl' module is used directly.
    chrzaszcz committed May 17, 2024
    Configuration menu
    Copy the full SHA
    b8c3ba9 View commit details
    Browse the repository at this point in the history
  2. Replace strings with binaries in the test GraphQL queries

    Otherwise, jiffy encodes them as lists of numbers,
    which makes them unreadable.
    chrzaszcz committed May 17, 2024
    Configuration menu
    Copy the full SHA
    bc25b4c View commit details
    Browse the repository at this point in the history
  3. Use the low-level TLS API in the GraphQL tests

    The motivation is to eliminate flakiness caused by race conditions.
    
    - Negative tests check TLS errors after connecting without sending
      any requests (which would cause the socket to return the 'closed'
      error if it was already closed)
    - Positive tests use the same internal API to make them similar, and
      to check that the API can handle succeess and failure.
    - Positive tests execute meaningful queries now.
    chrzaszcz committed May 17, 2024
    Configuration menu
    Copy the full SHA
    35c374d View commit details
    Browse the repository at this point in the history