spec/requests/api/graphql/current_user/todos_query_spec.rb:72 failing (flaky?)
Job #1509043491 failed for d1e9426b on master
:
Failures:
1) Query current user todos when requesting a single field avoids N+1 queries
Failure/Error: expect { post_graphql(query, current_user: current_user) }.not_to exceed_query_limit(control).with_threshold(2)
Expected a maximum of 48 (+2) queries, got 51:
Query Diff:
-----------
SELECT "personal_access_tokens".* FROM "personal_access_tokens"...
-- (expected: 2, got: 0)
WHERE "personal_access_tokens"."token_digest" = 'tqv2qzbgt7KMq/ZLR+VxL5FhKmh8C0lvilhF+qxmBWA=' LIMIT 1
-- (expected: 0, got: 2)
WHERE "personal_access_tokens"."token_digest" = 'SHGI6y4wUtZdxskxp/zW/plLv1btFn5nSjj/4SDLAvo=' LIMIT 1
INSERT INTO "personal_access_tokens" ("user_id", "name", "expires_at", "created_at", "updated_at", "scopes", "token_digest")...
-- (expected: 1, got: 0)
VALUES (2570, 'PAT 1022', '2021-08-22', '2021-08-17 09:08:59.976021', '2021-08-17 09:08:59.976021', '---
- api
', 'tqv2qzbgt7KMq/ZLR+VxL5FhKmh8C0lvilhF+qxmBWA=') RETURNING "id"
-- (expected: 0, got: 1)
VALUES (2570, 'PAT 1023', '2021-08-22', '2021-08-17 09:09:00.457683', '2021-08-17 09:09:00.457683', '---
- api
', 'SHGI6y4wUtZdxskxp/zW/plLv1btFn5nSjj/4SDLAvo=') RETURNING "id"
UPDATE "personal_access_tokens"...
-- (expected: 1, got: 0)
SET "last_used_at" = '2021-08-17 09:08:59.997522' WHERE "personal_access_tokens"."id" = 1022
-- (expected: 0, got: 1)
SET "last_used_at" = '2021-08-17 09:09:00.477797' WHERE "personal_access_tokens"."id" = 1023
SELECT "users".* FROM "users"...
-- (expected: 1, got: 0)
WHERE "users"."id" IN (2572, 2571)
-- (expected: 1, got: 0)
WHERE "users"."id" IN (2572, 2571, 2573)
-- (expected: 0, got: 1)
WHERE "users"."id" IN (2572, 2577, 2571)
-- (expected: 0, got: 1)
WHERE "users"."id" IN (2577, 2572, 2571, 2573)
-- (expected: 0, got: 1)
WHERE "users"."id" = 2577 LIMIT 1
SELECT "issues".* FROM "issues"...
-- (expected: 1, got: 0)
WHERE "issues"."id" IN (600, 599)
-- (expected: 0, got: 1)
WHERE "issues"."id" IN (604, 600, 599)
SELECT "timelogs".* FROM "timelogs"...
-- (expected: 1, got: 0)
WHERE "timelogs"."issue_id" IN (600, 599)
-- (expected: 0, got: 1)
WHERE "timelogs"."issue_id" IN (600, 604, 599)
SELECT "issue_assignees".* FROM "issue_assignees"...
-- (expected: 1, got: 0)
WHERE "issue_assignees"."issue_id" IN (600, 599)
-- (expected: 0, got: 1)
WHERE "issue_assignees"."issue_id" IN (600, 604, 599)
SELECT "label_links".* FROM "label_links"...
-- (expected: 1, got: 0)
WHERE "label_links"."target_type" = 'Issue' AND "label_links"."target_id" IN (600, 599)
-- (expected: 0, got: 1)
WHERE "label_links"."target_type" = 'Issue' AND "label_links"."target_id" IN (600, 604, 599)
SELECT "projects".* FROM "projects"...
-- (expected: 1, got: 0)
WHERE "projects"."id" IN (629, 628)
-- (expected: 0, got: 1)
WHERE "projects"."id" IN (629, 633, 628)
-- (expected: 0, got: 1)
WHERE "projects"."id" IN (633, 629, 628)
SELECT "routes".* FROM "routes"...
-- (expected: 1, got: 0)
WHERE "routes"."source_type" = 'Project' AND "routes"."source_id" IN (628, 629)
-- (expected: 1, got: 0)
WHERE "routes"."source_type" = 'Namespace' AND "routes"."source_id" IN (2990, 2991)
-- (expected: 0, got: 1)
WHERE "routes"."source_type" = 'Project' AND "routes"."source_id" IN (633, 628, 629)
-- (expected: 0, got: 1)
WHERE "routes"."source_type" = 'Namespace' AND "routes"."source_id" IN (2996, 2990, 2991)
SELECT "namespaces".* FROM "namespaces"...
-- (expected: 1, got: 0)
WHERE "namespaces"."id" IN (2990, 2991)
-- (expected: 0, got: 1)
WHERE "namespaces"."id" IN (2996, 2990, 2991)
-- (expected: 0, got: 1)
WHERE "namespaces"."type" = 'Group' AND "namespaces"."id" = 2996 LIMIT 1
SELECT "epic_issues".* FROM "epic_issues"...
-- (expected: 1, got: 0)
WHERE "epic_issues"."issue_id" IN (600, 599)
-- (expected: 0, got: 1)
WHERE "epic_issues"."issue_id" IN (600, 604, 599)
SELECT MAX("project_authorizations"."access_level") AS maximum_access_level, "project_authorizations"."project_id" AS project_authorizations_project_id FROM "project_authorizations"...
-- (expected: 1, got: 0)
WHERE "project_authorizations"."user_id" = 2570 AND "project_authorizations"."project_id" IN (629, 628, 628, 628, 628) GROUP BY "project_authorizations"."project_id"
-- (expected: 0, got: 1)
WHERE "project_authorizations"."user_id" = 2570 AND "project_authorizations"."project_id" IN (633, 629, 628, 628, 628, 628) GROUP BY "project_authorizations"."project_id"
# ./spec/requests/api/graphql/current_user/todos_query_spec.rb:81:in `block (3 levels) in <top (required)>'
# ./spec/spec_helper.rb:390:in `block (3 levels) in <top (required)>'
# ./spec/support/sidekiq_middleware.rb:9:in `with_sidekiq_server_middleware'
# ./spec/spec_helper.rb:381:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:377:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/application_context.rb:31:in `with_raw_context'
# ./spec/spec_helper.rb:377:in `block (2 levels) in <top (required)>'
# ./spec/spec_helper.rb:355:in `block (3 levels) in <top (required)>'
# ./lib/gitlab/with_request_store.rb:17:in `enabling_request_store'
# ./lib/gitlab/with_request_store.rb:10:in `with_request_store'
# ./spec/spec_helper.rb:355:in `block (2 levels) in <top (required)>'
Finished in 21 minutes 24 seconds (files took 53.88 seconds to load)
2819 examples, 1 failure, 1 pending
Failed examples:
rspec ./spec/requests/api/graphql/current_user/todos_query_spec.rb:72 # Query current user todos when requesting a single field avoids N+1 queries
Also failed on https://gitlab.com/gitlab-org/gitlab/-/jobs/1509115780 (MR)