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

graphql: fix spurious error in test #22164

Merged
merged 1 commit into from
Jan 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion graphql/graphql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ import (
)

func TestBuildSchema(t *testing.T) {
stack, err := node.New(&node.DefaultConfig)
ddir, err := ioutil.TempDir("", "graphql-buildschema")
if err != nil {
t.Fatalf("failed to create temporary datadir: %v", err)
}
// Copy config
conf := node.DefaultConfig
conf.DataDir = ddir
stack, err := node.New(&conf)
if err != nil {
t.Fatalf("could not create new node: %v", err)
}
Expand Down Expand Up @@ -157,6 +164,7 @@ func TestGraphQLHTTPOnSamePort_GQLRequest_Unsuccessful(t *testing.T) {
if err != nil {
t.Fatalf("could not read from response body: %v", err)
}
resp.Body.Close()
// make sure the request is not handled successfully
if want, have := "404 page not found\n", string(bodyBytes); have != want {
t.Errorf("have:\n%v\nwant:\n%v", have, want)
Expand Down