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

feat: make router-tests less flaky #1484

Open
wants to merge 47 commits into
base: main
Choose a base branch
from

Conversation

alepane21
Copy link
Contributor

@alepane21 alepane21 commented Jan 3, 2025

Motivation and Context

This is the second batch of fixes to reduce the flaky tests. In this PR I focused on:

  • deflake nats and kafka tests
  • separate the remaining flaky tests in a second test step that will retry them on failure

Checklist

  • I have discussed my proposed changes in an issue and have received approval to proceed.
  • I have followed the coding standards of the project.
  • Tests or benchmarks have been added or updated.
  • Documentation has been updated on https://github.com/wundergraph/cosmo-docs.
  • I have read the Contributors Guide.

Copy link

github-actions bot commented Jan 3, 2025

Router image scan passed

✅ No security vulnerabilities found in image:

ghcr.io/wundergraph/cosmo/router:sha-c257da7bd3a1f90510a4e7f937d9ee732cb8b815

@github-actions github-actions bot added the router label Jan 4, 2025
alepane21 and others added 24 commits January 7, 2025 12:26
…ss-flaky

# Conflicts:
#	router-tests/go.mod
#	router-tests/go.sum
@alepane21 alepane21 marked this pull request as ready for review January 29, 2025 14:47
res, err := xEnv.MakeGraphQLRequestWithContext(context.Background(), testenv.GraphQLRequest{
Query: `{ employees { id } }`,
})
require.NoError(t, err)
require.Equal(t, res.Response.StatusCode, 200)
require.Equal(t, `{"errors":[{"message":"Failed to fetch from Subgraph 'employees'."}],"data":{"employees":null}}`, res.Body)
assert.Equal(t, res.Response.StatusCode, 200)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we use assert, rather than require here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

From what I know, you should use the require only if you don't want the next assertion to run. In this instance I wanted to see the next assertion result to help me debug the issue when the test fails.

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

Successfully merging this pull request may close these issues.

2 participants