Skip to content

Commit 87b9115

Browse files
committed
intermittent failure view fixes
1 parent bdf1628 commit 87b9115

File tree

92 files changed

+684
-484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+684
-484
lines changed

comparison-tools/config_comparator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,14 @@ def get_local_environment_config(self) -> dict[str, Any]:
154154
result = subprocess.run(["python", "--version"], capture_output=True, text=True)
155155
if result.returncode == 0:
156156
config["python_version"] = result.stdout.strip()
157-
except:
157+
except Exception:
158158
pass
159159

160160
try:
161161
result = subprocess.run(["node", "--version"], capture_output=True, text=True)
162162
if result.returncode == 0:
163163
config["node_version"] = result.stdout.strip()
164-
except:
164+
except Exception:
165165
pass
166166

167167
return config
@@ -421,7 +421,7 @@ def main():
421421

422422
try:
423423
comparison = comparator.run_comparison()
424-
report = comparator.generate_report(comparison, args.output)
424+
_report = comparator.generate_report(comparison, args.output)
425425

426426
# Exit with error code if there are significant differences
427427
significant_diffs = [

comparison-tools/db_comparator.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ def get_database_info(self, conn: psycopg2.extensions.connection) -> dict[str, A
8585

8686
# Get table count
8787
cursor.execute("""
88-
SELECT COUNT(*) as table_count
89-
FROM information_schema.tables
88+
SELECT COUNT(*) as table_count
89+
FROM information_schema.tables
9090
WHERE table_schema = 'public';
9191
""")
9292
table_count = cursor.fetchone()["table_count"]
@@ -117,8 +117,8 @@ def get_table_info(
117117
cursor.execute(
118118
"""
119119
SELECT EXISTS (
120-
SELECT FROM information_schema.tables
121-
WHERE table_schema = 'public'
120+
SELECT FROM information_schema.tables
121+
WHERE table_schema = 'public'
122122
AND table_name = %s
123123
);
124124
""",
@@ -131,14 +131,14 @@ def get_table_info(
131131
# Get column information
132132
cursor.execute(
133133
"""
134-
SELECT
134+
SELECT
135135
column_name,
136136
data_type,
137137
is_nullable,
138138
column_default,
139139
character_maximum_length
140140
FROM information_schema.columns
141-
WHERE table_schema = 'public'
141+
WHERE table_schema = 'public'
142142
AND table_name = %s
143143
ORDER BY ordinal_position;
144144
""",
@@ -432,7 +432,7 @@ def main():
432432

433433
try:
434434
comparison = comparator.run_comparison()
435-
report = comparator.generate_report(comparison, args.output)
435+
_report = comparator.generate_report(comparison, args.output)
436436

437437
# Exit with error code if there are significant differences
438438
has_issues = (

comparison-tools/run_comparison.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def generate_html_report(self, master_report):
336336
<h1>Treeherder Master Comparison Report</h1>
337337
<p>Generated: {master_report["comparison_summary"]["timestamp"]}</p>
338338
</div>
339-
339+
340340
<div class="summary">
341341
<h2>Summary</h2>
342342
<p><strong>Local URL:</strong> {master_report["comparison_summary"]["local_base_url"]}</p>
@@ -346,15 +346,15 @@ def generate_html_report(self, master_report):
346346
<p><strong>Failed:</strong> {master_report["comparison_summary"]["failed_tools"]}</p>
347347
<p><strong>Success Rate:</strong> {master_report["comparison_summary"]["success_rate"]:.1f}%</p>
348348
</div>
349-
349+
350350
<div class="recommendations">
351351
<h2>Recommendations</h2>
352352
{self.format_recommendations_html(master_report["recommendations"])}
353353
</div>
354-
354+
355355
<h2>Tool Results</h2>
356356
{self.format_tool_results_html(master_report["tool_results"])}
357-
357+
358358
</body>
359359
</html>"""
360360

@@ -379,11 +379,11 @@ def format_tool_results_html(self, results):
379379
html += f"""
380380
<div class="tool-result {success_class}">
381381
<h3>{result["tool"].replace("_", " ").title()} - {status}</h3>
382-
382+
383383
{f"<p><strong>Report File:</strong> {result['report_file']}</p>" if result.get("report_file") else ""}
384-
384+
385385
{f"<h4>Output:</h4><pre>{result['output']}</pre>" if result.get("output") else ""}
386-
386+
387387
{f"<h4>Error:</h4><pre>{result['error']}</pre>" if result.get("error") else ""}
388388
</div>
389389
"""

tests/ui/job-view/App_test.jsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ describe('App', () => {
7878
[],
7979
);
8080
fetchMock.get(getProjectUrl('/jobs/259537375/', repoName), fullJob);
81+
fetchMock.get(
82+
getProjectUrl('/jobs/259537375/bug_suggestions/', repoName),
83+
[],
84+
);
8185
fetchMock.get(getProjectUrl('/jobs/259537372/', repoName), {
8286
...fullJob,
8387
task_id: 'secondTaskId',

tests/ui/job-view/bugfiler_test.jsx

Lines changed: 68 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,45 +26,85 @@ describe('BugFiler', () => {
2626
const suggestions = [
2727
{
2828
search: 'ShutdownLeaks | process() called before end of test suite',
29+
bugs: { open_recent: [], all_others: [] },
30+
counter: 1,
31+
failure_in_new_rev: false,
32+
line_number: 1,
33+
path_end: null,
34+
search_terms: [],
2935
},
3036
{
3137
search:
3238
'browser/components/search/test/browser_searchbar_smallpanel_keyboard_navigation.js | application terminated with exit code 11',
39+
bugs: { open_recent: [], all_others: [] },
40+
counter: 1,
41+
failure_in_new_rev: false,
42+
line_number: 2,
43+
path_end:
44+
'browser/components/search/test/browser_searchbar_smallpanel_keyboard_navigation.js',
45+
search_terms: [],
3346
},
3447
{
3548
search:
3649
'browser/components/search/test/browser_searchbar_smallpanel_keyboard_navigation.js | application crashed [@ js::GCMarker::eagerlyMarkChildren]',
50+
bugs: { open_recent: [], all_others: [] },
51+
counter: 1,
52+
failure_in_new_rev: false,
53+
line_number: 3,
54+
path_end:
55+
'browser/components/search/test/browser_searchbar_smallpanel_keyboard_navigation.js',
56+
search_terms: [],
3757
},
3858
{
3959
search:
4060
'leakcheck | default process: missing output line for total leaks!',
61+
bugs: { open_recent: [], all_others: [] },
62+
counter: 1,
63+
failure_in_new_rev: false,
64+
line_number: 4,
65+
path_end: null,
66+
search_terms: [],
67+
},
68+
{
69+
search: '# TBPL FAILURE #',
70+
bugs: { open_recent: [], all_others: [] },
71+
counter: 1,
72+
failure_in_new_rev: false,
73+
line_number: 5,
74+
path_end: null,
75+
search_terms: [],
4176
},
42-
{ search: '# TBPL FAILURE #' },
4377
];
4478

4579
const PdfSuggestions = [
4680
{
47-
bugs: {},
81+
bugs: { open_recent: [], all_others: [] },
4882
line_number: 10,
4983
path_end: 'browser/extensions/pdfjs/test/browser_pdfjs_views.js',
5084
search_terms: [],
5185
search:
5286
'TEST-UNEXPECTED-FAIL | browser/extensions/pdfjs/test/browser_pdfjs_views.js | Test timed out -',
87+
counter: 1,
88+
failure_in_new_rev: false,
5389
},
5490
{
55-
bugs: {},
91+
bugs: { open_recent: [], all_others: [] },
5692
line_number: 235,
5793
path_end: 'browser/extensions/pdfjs/test/browser_pdfjs_views.js',
5894
search_terms: [],
5995
search:
6096
'TEST-UNEXPECTED-FAIL | browser/extensions/pdfjs/test/browser_pdfjs_views.js | Found a tab after previous test timed out: about:blank -',
97+
counter: 1,
98+
failure_in_new_rev: false,
6199
},
62100
{
63-
bugs: {},
101+
bugs: { open_recent: [], all_others: [] },
64102
line_number: 783,
65103
path_end: 'flee',
66104
search_terms: [],
67105
search: 'REFTEST TEST-UNEXPECTED-PASS | flee | floo',
106+
counter: 1,
107+
failure_in_new_rev: false,
68108
},
69109
];
70110

@@ -82,6 +122,24 @@ describe('BugFiler', () => {
82122
},
83123
],
84124
);
125+
fetchMock.mock(
126+
`/api${bzComponentEndpoint}?path=browser%2Fcomponents%2Fsearch%2Ftest%2Fbrowser_searchbar_smallpanel_keyboard_navigation.js`,
127+
[
128+
{
129+
product: 'Firefox',
130+
component: 'Search',
131+
},
132+
],
133+
);
134+
fetchMock.mock(
135+
`/api${bzComponentEndpoint}?path=browser%2Fcomponents%2Fsessionstore%2Ftest%2Fbrowser_625016.js`,
136+
[
137+
{
138+
product: 'Firefox',
139+
component: 'Session Restore',
140+
},
141+
],
142+
);
85143

86144
fetchMock.mock(
87145
`${bzBaseUrl}rest/prod_comp_search/find/firefox%20::%20search?limit=5`,
@@ -175,6 +233,12 @@ describe('BugFiler', () => {
175233
'browser_searchbar_smallpanel_keyboard_navigation.js", "[@ js::GCMarker::eagerlyMarkChildren]',
176234
],
177235
search: summary,
236+
bugs: { open_recent: [], all_others: [] },
237+
counter: 1,
238+
failure_in_new_rev: false,
239+
line_number: 1,
240+
path_end:
241+
'browser/components/search/test/browser_searchbar_smallpanel_keyboard_navigation.js',
178242
};
179243

180244
render(bugFilerComponentSuggestion(suggestion));

tests/ui/perfherder/graphs-view/timerange_dropdown_test.jsx

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,32 @@ afterEach(() => {
1919
});
2020

2121
describe('Selecting different dropdown items in TimeRangeDropdown', () => {
22-
let dropdownMenu;
22+
test('Dropdown can be opened and item selected', async () => {
23+
const { getByText } = timeRangeDropdown();
2324

24-
beforeEach(async () => {
25-
const { getByLabelText, getByText } = timeRangeDropdown();
26-
27-
dropdownMenu = await waitFor(() => getByLabelText('Time range'));
28-
fireEvent.click(dropdownMenu);
25+
const dropdownToggle = await waitFor(() => getByText('Last 14 days'));
26+
fireEvent.click(dropdownToggle);
2927

3028
const anotherItem = await waitFor(() => getByText('Last 60 days'));
3129
fireEvent.click(anotherItem);
32-
});
3330

34-
test('Menu updates to new item', async () => {
35-
expect(dropdownMenu).toHaveTextContent('Last 60 days');
31+
// Component is controlled, so text won't change until parent re-renders
32+
// Check that the callback was called with correct values
33+
expect(updateTimeRange).toHaveBeenCalledWith({
34+
value: 5184000,
35+
text: 'Last 60 days',
36+
});
3637
});
3738

3839
test('TimeRangeDropdown calls back with correct time range', async () => {
40+
const { getByText } = timeRangeDropdown();
41+
42+
const dropdownToggle = await waitFor(() => getByText('Last 14 days'));
43+
fireEvent.click(dropdownToggle);
44+
45+
const anotherItem = await waitFor(() => getByText('Last 60 days'));
46+
fireEvent.click(anotherItem);
47+
3948
expect(updateTimeRange).toHaveBeenCalledWith({
4049
value: 5184000,
4150
text: 'Last 60 days',

0 commit comments

Comments
 (0)