-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BE] Put all the flaky test related queries into one subfolder, move …
…adhoc queries to saved queries (#6321) * Puts queries related to flaky tests into a subfolder for better organization * Renames some of the queries to be more helpful * Moves some adhoc queries to named/saved queries
- Loading branch information
Showing
19 changed files
with
187 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
torchci/clickhouse_queries/flaky_tests/across_file_reruns/check_every_test/params.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"params": { | ||
"name": "String", | ||
"classname": "String", | ||
"invoking_file": "String", | ||
"file": "String", | ||
"numHours": "Int32" | ||
}, | ||
"tests": [] | ||
} |
29 changes: 29 additions & 0 deletions
29
torchci/clickhouse_queries/flaky_tests/across_file_reruns/check_every_test/query.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
select | ||
name, | ||
classname as suite, | ||
file, | ||
invoking_file, | ||
job_id, | ||
1 as numGreen, | ||
SUM(LENGTH(rerun)) as numRed, | ||
any(rerun[1].'text') as sampleTraceback | ||
FROM | ||
default.test_run_s3 | ||
where | ||
name = {name: String} | ||
and classname = {classname: String} | ||
and invoking_file = {invoking_file: String} | ||
and file = {file: String} | ||
and LENGTH(skipped) = 0 | ||
and time_inserted > (CURRENT_TIMESTAMP() - interval {numHours: Int64} hour) | ||
GROUP BY | ||
name, | ||
suite, | ||
file, | ||
invoking_file, | ||
job_id | ||
HAVING | ||
-- succeded at least once | ||
MIN(LENGTH(failure) + LENGTH(error)) = 0 | ||
-- failed completely at least once | ||
and MAX(LENGTH(failure) + LENGTH(error)) != 0 |
6 changes: 6 additions & 0 deletions
6
torchci/clickhouse_queries/flaky_tests/across_file_reruns/failed_tests/params.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"params": { | ||
"numHours": "Int32" | ||
}, | ||
"tests": [] | ||
} |
14 changes: 14 additions & 0 deletions
14
torchci/clickhouse_queries/flaky_tests/across_file_reruns/failed_tests/query.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
select | ||
DISTINCT name, | ||
file, | ||
invoking_file, | ||
classname | ||
from | ||
default .test_run_s3 | ||
where | ||
( | ||
LENGTH(failure) != 0 | ||
or LENGTH(error) != 0 | ||
) | ||
and file != '' | ||
and time_inserted > (CURRENT_TIMESTAMP() - interval {numHours: Int64} hour) |
6 changes: 6 additions & 0 deletions
6
torchci/clickhouse_queries/flaky_tests/across_file_reruns/workflow_job_info/params.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"params": { | ||
"job_ids": "Array(Int64)" | ||
}, | ||
"tests": [] | ||
} |
24 changes: 24 additions & 0 deletions
24
torchci/clickhouse_queries/flaky_tests/across_file_reruns/workflow_job_info/query.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
with jobs as ( | ||
select | ||
name, | ||
id, | ||
run_id, | ||
run_attempt, | ||
html_url | ||
from default.workflow_job final | ||
where | ||
id in {job_ids: Array(Int64)} | ||
and name not like '%rerun_disabled_tests%' | ||
) | ||
select | ||
j.name as name, | ||
w.name as workflow_name, | ||
j.id as id, | ||
w.id as workflow_id, | ||
w.head_branch as head_branch, | ||
j.run_attempt as run_attempt, | ||
j.html_url as html_url | ||
from | ||
default.workflow_run w final join jobs j on w.id = j.run_id | ||
where | ||
w.id in (select run_id from jobs) |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions
16
torchci/clickhouse_queries/flaky_tests/ind_info/params.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"params": { | ||
"limit": "Int32", | ||
"name": "String", | ||
"suite": "String", | ||
"file": "String" | ||
}, | ||
"tests": [ | ||
{ | ||
"limit": 100, | ||
"name": "test_non_contiguous_tensors_nn_ConvTranspose1d_cuda_complex32", | ||
"suite": "TestModuleCUDA", | ||
"file": "test_modules.py" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
-- File location is misleading, this is actually just any failed test, not | ||
-- necessarily flaky. | ||
WITH failed_test_runs AS ( | ||
SELECT | ||
t.name AS name, | ||
t.classname AS classname, | ||
t.file AS file, | ||
t.invoking_file AS invoking_file, | ||
t.job_id | ||
FROM default.failed_test_runs AS t | ||
WHERE | ||
t.name = {name: String} | ||
AND t.classname = {suite: String} | ||
AND t.file = {file: String} | ||
), | ||
|
||
failed_jobs AS ( | ||
SELECT | ||
j.conclusion AS conclusion, | ||
j.id AS id, | ||
j.run_id AS run_id, | ||
j.name AS name, | ||
j.html_url AS html_url, | ||
j.started_at AS started_at, | ||
tupleElement(j.torchci_classification, 'line') AS line, | ||
tupleElement(j.torchci_classification, 'line_num') AS line_num, | ||
tupleElement(j.torchci_classification, 'captures') AS captures, | ||
j.head_sha AS head_sha | ||
FROM default.workflow_job AS j | ||
WHERE | ||
j.id IN (SELECT t.job_id FROM failed_test_runs t) | ||
) | ||
|
||
SELECT DISTINCT | ||
t.name AS name, | ||
t.classname AS classname, | ||
t.file AS file, | ||
t.invoking_file AS invoking_file, | ||
j.conclusion AS conclusion, | ||
j.id AS job_id, | ||
j.name AS job_name, | ||
j.html_url AS job_url, | ||
j.started_at AS job_started_at, | ||
j.line AS line, | ||
j.line_num AS line_num, | ||
j.captures AS captures, | ||
w.head_branch AS head_branch, | ||
j.head_sha AS head_sha | ||
FROM failed_jobs AS j | ||
INNER JOIN failed_test_runs AS t ON j.id = t.job_id | ||
INNER JOIN default.workflow_run AS w ON w.id = j.run_id | ||
ORDER BY j.started_at DESC | ||
LIMIT | ||
{limit: Int32} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.