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

Add more tests validating different statuses #2705

Merged
merged 1 commit into from
May 5, 2023

Conversation

domdomegg
Copy link
Contributor

Related #2655

Went down this rabbit hole trying to identify root cause of odd behaviour of status texts in graphql-yoga. This doesn't make any non-test changes, but given that I've written these tests now I thought they may be helpful to prevent future regressions so figured would at least submit the PR :)

@changeset-bot
Copy link

changeset-bot bot commented Apr 21, 2023

⚠️ No Changeset found

Latest commit: e4bce22

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@domdomegg
Copy link
Contributor Author

Converting to draft while tests failing

@domdomegg domdomegg marked this pull request as draft April 21, 2023 09:41
@domdomegg domdomegg marked this pull request as ready for review April 22, 2023 12:30
variables: { status },
}),
}),
new Response(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually yoga handler doesn't work like that.
If you try to mimic yoga(req, res), this is different.
There is no Response passed in Fetch API based servers. It is Node specific and parameters are IncomingMessage and ServerResponse.
In Fetch API based servers, the handler takes Request and returns Response.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@domdomegg domdomegg force-pushed the status-text-tests branch from 454eb18 to e4bce22 Compare May 1, 2023 19:33
@ardatan ardatan merged commit 2234a6a into dotansimha:main May 5, 2023
@ardatan
Copy link
Collaborator

ardatan commented May 5, 2023

Thanks @domdomegg !

@github-actions
Copy link
Contributor

github-actions bot commented May 5, 2023

❌ Benchmark Failed

Performance regression detected: it seems like your Pull Request adds some extra latency to GraphQL Yoga

If the performance regression is expected, please increase the failing threshold.

     ✓ no_errors{mode:graphql}
     ✓ expected_result{mode:graphql}
     ✓ no_errors{mode:graphql-jit}
     ✓ expected_result{mode:graphql-jit}
     ✓ no_errors{mode:graphql-response-cache}
     ✓ expected_result{mode:graphql-response-cache}
     ✓ no_errors{mode:graphql-no-parse-validate-cache}
     ✓ expected_result{mode:graphql-no-parse-validate-cache}

     checks.......................................: 100.00% ✓ 192858     ✗ 0    
     data_received................................: 797 MB  6.6 MB/s
     data_sent....................................: 39 MB   325 kB/s
     http_req_blocked.............................: avg=2.97µs   min=1.5µs   med=2.4µs   max=1.24ms  p(90)=3.2µs   p(95)=3.7µs   
     http_req_connecting..........................: avg=16ns     min=0s      med=0s      max=529.6µs p(90)=0s      p(95)=0s      
     http_req_duration............................: avg=865.2µs  min=395.9µs med=682.8µs max=33.35ms p(90)=1.18ms  p(95)=1.39ms  
       { expected_response:true }.................: avg=865.2µs  min=395.9µs med=682.8µs max=33.35ms p(90)=1.18ms  p(95)=1.39ms  
     ✓ { mode:graphql-jit }.......................: avg=687.18µs min=395.9µs med=579.6µs max=24.08ms p(90)=745.6µs p(95)=945.25µs
     ✗ { mode:graphql-no-parse-validate-cache }...: avg=1.28ms   min=849.9µs med=1.12ms  max=29.68ms p(90)=1.44ms  p(95)=2.09ms  
     ✓ { mode:graphql-response-cache }............: avg=739.31µs min=435.1µs med=623.7µs max=13.92ms p(90)=802µs   p(95)=1.02ms  
     ✓ { mode:graphql }...........................: avg=902.47µs min=533.6µs med=751.2µs max=33.35ms p(90)=1ms     p(95)=1.33ms  
     http_req_failed..............................: 0.00%   ✓ 0          ✗ 96429
     http_req_receiving...........................: avg=51.43µs  min=24.8µs  med=42.7µs  max=13.96ms p(90)=63µs    p(95)=78.2µs  
     http_req_sending.............................: avg=23.22µs  min=8.9µs   med=13.3µs  max=12.96ms p(90)=25.5µs  p(95)=33.3µs  
     http_req_tls_handshaking.....................: avg=0s       min=0s      med=0s      max=0s      p(90)=0s      p(95)=0s      
     http_req_waiting.............................: avg=790.54µs min=353.9µs med=617.7µs max=33.24ms p(90)=1.1ms   p(95)=1.27ms  
     http_reqs....................................: 96429   803.550965/s
     iteration_duration...........................: avg=1.23ms   min=651µs   med=1.03ms  max=33.76ms p(90)=1.56ms  p(95)=1.94ms  
     iterations...................................: 96429   803.550965/s
     vus..........................................: 1       min=1        max=2  
     vus_max......................................: 2       min=2        max=2  

@domdomegg domdomegg deleted the status-text-tests branch May 6, 2023 19:32
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

Successfully merging this pull request may close these issues.

2 participants