Skip to content

Commit 4c26d05

Browse files
committed
fix: add long running test
1 parent 9a8dec8 commit 4c26d05

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

src/containers/Tenant/Query/QueryEditorControls/EditorButton.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
}
99

1010
&__stop-button {
11+
color: var(--g-color-text-brand-contrast);
1112
background-color: var(--g-color-text-danger);
12-
1313
&_error {
1414
@include mixins.query-buttons-animations();
1515
}

tests/suites/tenant/constants.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ export const simpleQuery = 'SELECT 1;';
55
export const longTableSelect = 'SELECT * FROM `.sys/pg_class`';
66

77
// 400 is pretty enough
8-
export const longRunningQuery = new Array(400).fill(simpleQuery).join('');
8+
export const longRunningQuery = `
9+
$sample = AsList(AsStruct(ListFromRange(1, 100000) AS value, CAST(1 AS Uint32) AS id));
10+
11+
SELECT value, id FROM as_table($sample) FLATTEN BY (value);`;
912

1013
export const createTableQuery = `
1114
CREATE TABLE \`/local/ydb_row_table\` (

tests/suites/tenant/queryEditor/queryEditor.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {expect, test} from '@playwright/test';
33
import {QUERY_MODES, STATISTICS_MODES} from '../../../../src/utils/query';
44
import {getClipboardContent} from '../../../utils/clipboard';
55
import {tenantName} from '../../../utils/constants';
6+
import {toggleExperiment} from '../../../utils/toggleExperiment';
67
import {NavigationTabs, TenantPage, VISIBILITY_TIMEOUT} from '../TenantPage';
78
import {createTableQuery, longRunningQuery, longTableSelect} from '../constants';
89

@@ -102,6 +103,19 @@ test.describe('Test Query Editor', async () => {
102103
await expect(queryEditor.isElapsedTimeVisible()).resolves.toBe(true);
103104
});
104105

106+
test('Query streaming finishes in reasonable time', async ({page}) => {
107+
const queryEditor = new QueryEditor(page);
108+
await toggleExperiment(page, 'on', 'Query Streaming');
109+
110+
await queryEditor.clickGearButton();
111+
await queryEditor.settingsDialog.changeLimitRows(100000);
112+
await queryEditor.settingsDialog.clickButton(ButtonNames.Save);
113+
await queryEditor.setQuery(longRunningQuery);
114+
await queryEditor.clickRunButton();
115+
116+
await expect(queryEditor.waitForStatus('Completed')).resolves.toBe(true);
117+
});
118+
105119
test('Query execution is terminated when stop button is clicked', async ({page}) => {
106120
const queryEditor = new QueryEditor(page);
107121

0 commit comments

Comments
 (0)