mirror of
https://github.com/apache/superset.git
synced 2026-04-25 19:14:27 +00:00
feat(sqllab): Add timeout on fetching query results (#29959)
This commit is contained in:
@@ -32,6 +32,7 @@ import {
|
||||
initialState,
|
||||
user,
|
||||
queryWithNoQueryLimit,
|
||||
failedQueryWithFrontendTimeoutErrors,
|
||||
} from 'src/SqlLab/fixtures';
|
||||
|
||||
const mockedProps = {
|
||||
@@ -104,6 +105,16 @@ const failedQueryWithErrorsState = {
|
||||
},
|
||||
},
|
||||
};
|
||||
const failedQueryWithTimeoutState = {
|
||||
...initialState,
|
||||
sqlLab: {
|
||||
...initialState.sqlLab,
|
||||
queries: {
|
||||
[failedQueryWithFrontendTimeoutErrors.id]:
|
||||
failedQueryWithFrontendTimeoutErrors,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
const newProps = {
|
||||
displayLimit: 1001,
|
||||
@@ -319,6 +330,18 @@ describe('ResultSet', () => {
|
||||
expect(screen.getByText('Database error')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('should render a timeout error with a retrial button', async () => {
|
||||
await waitFor(() => {
|
||||
setup(
|
||||
{ ...mockedProps, queryId: failedQueryWithFrontendTimeoutErrors.id },
|
||||
mockStore(failedQueryWithTimeoutState),
|
||||
);
|
||||
});
|
||||
expect(
|
||||
screen.getByRole('button', { name: /Retry fetching results/i }),
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
test('renders if there is no limit in query.results but has queryLimit', async () => {
|
||||
const query = {
|
||||
...queries[0],
|
||||
|
||||
Reference in New Issue
Block a user