This is an automated email from the ASF dual-hosted git repository.
adoroszlai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 8f4347592d0 HDDS-17411. Show one initialization notice on the
Namespace Usage page (#11737)
8f4347592d0 is described below
commit 8f4347592d082e7affd8abe976270eb9a86b4745
Author: Andy Huang <[email protected]>
AuthorDate: Tue Oct 27 06:04:00 2026 +0800
HDDS-17411. Show one initialization notice on the Namespace Usage page
(#11737)
---
.../src/__tests__/namespaceUsage/NUMetadata.test.tsx | 12 ++++++------
.../src/__tests__/namespaceUsage/NamespaceUsage.test.tsx | 7 +++++--
.../src/v2/components/nuMetadata/nuMetadata.tsx | 1 -
3 files changed, 11 insertions(+), 9 deletions(-)
diff --git
a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/__tests__/namespaceUsage/NUMetadata.test.tsx
b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/__tests__/namespaceUsage/NUMetadata.test.tsx
index e1cd513e004..0acfa25b995 100644
---
a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/__tests__/namespaceUsage/NUMetadata.test.tsx
+++
b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/__tests__/namespaceUsage/NUMetadata.test.tsx
@@ -43,7 +43,7 @@ describe('Namespace Usage metadata', () => {
});
afterAll(() => server.close());
- test('hides quota rows and reports initialization once when both responses
are initializing', async () => {
+ test('hides summary and quota rows without notifying when both responses are
initializing', async () => {
server.use(
http.get('/api/v1/namespace/summary', () =>
HttpResponse.json(mockResponses.InitializingSummaryResponse)),
http.get('/api/v1/namespace/quota', () => HttpResponse.json({
@@ -51,14 +51,14 @@ describe('Namespace Usage metadata', () => {
}))
);
- render(<NUMetadata path='/' />);
+ const { container } = render(<NUMetadata path='/' />);
- await waitFor(() => expect(showDataFetchError).toHaveBeenCalledWith(
- 'The metadata is currently initializing. Please wait a moment and try
again later'
- ));
+ await waitFor(() =>
expect(container.querySelector('.ant-spin-spinning')).not.toBeInTheDocument());
+ expect(screen.queryByText('Entity Type')).not.toBeInTheDocument();
+ expect(screen.queryByText('Volumes')).not.toBeInTheDocument();
expect(screen.queryByText('Quota Allowed')).not.toBeInTheDocument();
expect(screen.queryByText('Quota Used')).not.toBeInTheDocument();
- expect(showDataFetchError).toHaveBeenCalledTimes(1);
+ expect(showDataFetchError).not.toHaveBeenCalled();
});
test.each([
diff --git
a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/__tests__/namespaceUsage/NamespaceUsage.test.tsx
b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/__tests__/namespaceUsage/NamespaceUsage.test.tsx
index f9d0d9e0c1d..98a04eb7b34 100644
---
a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/__tests__/namespaceUsage/NamespaceUsage.test.tsx
+++
b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/__tests__/namespaceUsage/NamespaceUsage.test.tsx
@@ -212,7 +212,7 @@ describe('Namespace Usage page (Disk Usage)', () => {
});
});
- test('notifies when namespace summary is still initializing', async () => {
+ test('shows only one notice when usage, summary and quota are initializing',
async () => {
namespaceUsageServer.use(
http.get('/api/v1/namespace/usage', () =>
HttpResponse.json(mockResponses.InitializingUsage)),
@@ -222,7 +222,7 @@ describe('Namespace Usage page (Disk Usage)', () => {
HttpResponse.json(mockResponses.InitializingQuotaResponse))
);
- render(<NamespaceUsage />);
+ const { container } = render(<NamespaceUsage />);
await confirmRootLoad();
await waitFor(() =>
@@ -231,5 +231,8 @@ describe('Namespace Usage page (Disk Usage)', () => {
expect.stringContaining('Namespace Summary is being initialized')
)
);
+ await waitFor(() =>
expect(container.querySelector('.ant-spin-spinning')).not.toBeInTheDocument());
+ expect(commonUtils.showInfoNotification).toHaveBeenCalledTimes(1);
+ expect(commonUtils.showDataFetchError).not.toHaveBeenCalled();
});
});
diff --git
a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/nuMetadata/nuMetadata.tsx
b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/nuMetadata/nuMetadata.tsx
index 6355cbee2a4..94c783d1392 100644
---
a/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/nuMetadata/nuMetadata.tsx
+++
b/hadoop-ozone/recon/src/main/resources/webapps/recon/ozone-recon-web/src/v2/components/nuMetadata/nuMetadata.tsx
@@ -278,7 +278,6 @@ const NUMetadata: React.FC<MetadataProps> = ({
// Error checks for summary response
if (summaryResponse.status === 'INITIALIZING') {
summaryResponsePresent = false;
- showDataFetchError(`The metadata is currently initializing. Please
wait a moment and try again later`);
}
if (summaryResponse.status === 'PATH_NOT_FOUND' || quotaResponse.status
=== 'PATH_NOT_FOUND') {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]