From 68419be04b43ebdc756d2aa56fcda61c591d4793 Mon Sep 17 00:00:00 2001
From: Alexander Moses
Date: Fri, 15 May 2026 13:16:06 +0000
Subject: [PATCH 1/2] Bug-2003889: Return an appropriate message when lando is
still loading
- Updated the response message in src/logic/treeherder.ts to convey to
the user that lando has still not completed the try pushes.
- Added the required unit tests
---
src/__tests__/App.test.tsx | 29 +++
src/__tests__/__snapshots__/App.test.tsx.snap | 201 ++++++++++++++++++
src/logic/treeherder.ts | 29 ++-
3 files changed, 252 insertions(+), 7 deletions(-)
diff --git a/src/__tests__/App.test.tsx b/src/__tests__/App.test.tsx
index a418178d9..e0e464156 100644
--- a/src/__tests__/App.test.tsx
+++ b/src/__tests__/App.test.tsx
@@ -148,6 +148,35 @@ describe('App', () => {
expect(document.body).toMatchSnapshot();
});
+ it('Should render the correct error message to the console when new_revision is required but missing', async () => {
+ // Silence console.error for a better console output.
+ jest.spyOn(console, 'error').mockImplementation(() => {});
+ fetchMock.get(
+ 'begin:https://treeherder.mozilla.org/api/perfcompare/results/',
+ {
+ status: 400,
+ body: JSON.stringify({
+ new_revision: ['This field may not be blank.'],
+ }),
+ },
+ );
+
+ await router.navigate(
+ '/compare-results/?baseRev=spam&baseRepo=mozilla-central&framework=2',
+ );
+ render();
+
+ await screen.findByText(/Error/);
+ expect(console.error).toHaveBeenCalledWith(
+ new Error(
+ 'The comparison cannot be performed because the `new_revision` field is missing. ' +
+ 'This typically happens when the `mach try perf` push is still being processed by Lando. ' +
+ 'Please wait a few moments for the push to complete and then refresh the page.',
+ ),
+ );
+ expect(document.body).toMatchSnapshot();
+ });
+
it('Should render an error page for compare over time when the treeherder request fails with an error 400', async () => {
// Silence console.error for a better console output. We'll check its result later.
jest.spyOn(console, 'error').mockImplementation(() => {});
diff --git a/src/__tests__/__snapshots__/App.test.tsx.snap b/src/__tests__/__snapshots__/App.test.tsx.snap
index af36bb4d7..a28fd4f68 100644
--- a/src/__tests__/__snapshots__/App.test.tsx.snap
+++ b/src/__tests__/__snapshots__/App.test.tsx.snap
@@ -695,3 +695,204 @@ exports[`App CompareResults or CompareOverTime loader Should render an error pag
+
+
+
+
+
+
+
+ Error:
+ The comparison cannot be performed because the \`new_revision\` field is missing. This typically happens when the \`mach try perf\` push is still being processed by Lando. Please wait a few moments for the push to complete and then refresh the page.
+
+
+ More information about this error has been written to the Web Console.
+
+
+
+
+