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(GraphQL): fixes flaky test for subscriptions. #6065

Merged
merged 13 commits into from
Oct 8, 2020

Conversation

JatinDev543
Copy link
Contributor

@JatinDev543 JatinDev543 commented Jul 24, 2020

Fixes DGRAPH-2305


This change is Reviewable

Docs Preview: Dgraph Preview

@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label Jul 24, 2020
Copy link

@arijitAD arijitAD left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @jatindevdg, @MichaelJCompton, and @pawanrawal)


graphql/e2e/subscription/subscription_test.go, line 584 at r1 (raw file):

	}
	addResult = add.ExecuteAsPost(t, graphQLEndpoint)
	require.Nil(t, addResult.Errors)

Why weren't we sending the request previously? Was it intentional or did we miss out?

@JatinDev543
Copy link
Contributor Author

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @jatindevdg, @MichaelJCompton, and @pawanrawal)

graphql/e2e/subscription/subscription_test.go, line 584 at r1 (raw file):

	}
	addResult = add.ExecuteAsPost(t, graphQLEndpoint)
	require.Nil(t, addResult.Errors)

Why weren't we sending the request previously? Was it intentional or did we miss out?

we missed it somehow.

@JatinDev543 JatinDev543 changed the title fix(GraphQL): fixes flaky test "TestSubscriptionAuth_SameQueryDifferentClaimsAndExpiry_ShouldExpireIndependently" for subscriptions. fix(GraphQL): fixes test "TestSubscriptionAuth_SameQueryDifferentClaimsAndExpiry_ShouldExpireIndependently" for subscriptions. Jul 24, 2020
@JatinDev543 JatinDev543 changed the title fix(GraphQL): fixes test "TestSubscriptionAuth_SameQueryDifferentClaimsAndExpiry_ShouldExpireIndependently" for subscriptions. fix(GraphQL): fixes test for subscriptions. Jul 24, 2020
Copy link
Contributor

@pawanrawal pawanrawal left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 4 unresolved discussions (waiting on @arijitAD, @jatindevdg, @MichaelJCompton, and @pawanrawal)


graphql/e2e/subscription/subscription_test.go, line 754 at r2 (raw file):

	err = json.Unmarshal(res, &resp)
	require.NoError(t, err)
	require.Nil(t, resp.Errors)

Shouldn't we check resp.Errors before we do the json.Unmarshal?


graphql/e2e/subscription/subscription_test.go, line 768 at r2 (raw file):

	// add delay for 2nd subscription  to timeout
	// Wait for JWT to expire.
	time.Sleep(20 * time.Second)

Why does this need to be increased? Is 10 not enough?


graphql/e2e/subscription/subscription_test.go, line 785 at r2 (raw file):

	}

	addResult = add.ExecuteAsPost(t, graphQLEndpoint)

Didn't we fix this before? I thought we did.

Copy link
Contributor Author

@JatinDev543 JatinDev543 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 4 unresolved discussions (waiting on @arijitAD, @MichaelJCompton, and @pawanrawal)


graphql/e2e/subscription/subscription_test.go, line 754 at r2 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

Shouldn't we check resp.Errors before we do the json.Unmarshal?

no, i checked that, resp is filled while unmarshling, so we should check resp.errors after unmarshling.


graphql/e2e/subscription/subscription_test.go, line 768 at r2 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

Why does this need to be increased? Is 10 not enough?

fixed it.


graphql/e2e/subscription/subscription_test.go, line 785 at r2 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

Didn't we fix this before? I thought we did.

i missed it at some places.fixed it.

Copy link

@codelingo codelingo bot left a comment

Choose a reason for hiding this comment

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

LGTM. 3 rules errored during the review.

Copy link

@codelingo codelingo bot left a comment

Choose a reason for hiding this comment

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

1 issues found. 9 rules errored during the review.

@@ -71,8 +71,9 @@ const (
`
)

func TestSubscription(t *testing.T) {
var subExp = 3 * time.Second
Copy link

Choose a reason for hiding this comment

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

Avoid global variables to improve readability and reduce complexity

View Rule

@JatinDev543 JatinDev543 changed the title fix(GraphQL): fixes test for subscriptions. fix(GraphQL): fixes flaky test for subscriptions. Oct 8, 2020
@JatinDev543 JatinDev543 merged commit b4c6a73 into master Oct 8, 2020
@JatinDev543 JatinDev543 deleted the jatin/authSubscription-fleakyTest branch October 8, 2020 11:05
JatinDev543 added a commit that referenced this pull request Oct 14, 2020
JatinDev543 added a commit that referenced this pull request Oct 15, 2020
JatinDev543 added a commit that referenced this pull request Oct 15, 2020
pawanrawal pushed a commit that referenced this pull request Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphql Issues related to GraphQL support on Dgraph.
Development

Successfully merging this pull request may close these issues.

3 participants