-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix: action buttons visible immediately despite slow pipelineStatus API #27139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
a954605
6830e31
9b5b89c
36961ce
e0725c0
fac65c7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -386,3 +386,159 @@ | |
| }); | ||
| } | ||
| ); | ||
|
|
||
| const slowPipelineService = new MysqlIngestionClass({ | ||
| shouldTestConnection: false, | ||
| shouldAddIngestion: false, | ||
| }); | ||
| let slowTestPipeline: { | ||
| id: string; | ||
| name: string; | ||
| fullyQualifiedName: string; | ||
| }; | ||
|
|
||
| test.describe.serial( | ||
| 'Action buttons visible despite slow pipelineStatus API', | ||
| PLAYWRIGHT_INGESTION_TAG_OBJ, | ||
| () => { | ||
| test.beforeEach('Navigate to database services', async ({ page }) => { | ||
| await redirectToHomePage(page); | ||
| await settingClick( | ||
| page, | ||
| slowPipelineService.category as unknown as SettingOptionsType | ||
| ); | ||
| }); | ||
|
|
||
| test('Setup: create MySQL service and ingestion pipeline', async ({ | ||
| page, | ||
| }) => { | ||
| await slowPipelineService.createService(page); | ||
|
|
||
| const { apiContext } = await getApiContext(page); | ||
|
|
||
| const serviceResponse = await apiContext | ||
| .get( | ||
| `/api/v1/services/databaseServices/name/${encodeURIComponent( | ||
| slowPipelineService.getServiceName() | ||
| )}` | ||
| ) | ||
| .then((res) => res.json()); | ||
|
|
||
| const createPipelineResponse = await apiContext.post( | ||
| '/api/v1/services/ingestionPipelines', | ||
| { | ||
| data: { | ||
| airflowConfig: {}, | ||
| loggerLevel: 'INFO', | ||
| name: `${slowPipelineService.getServiceName()}-metadata`, | ||
| pipelineType: 'metadata', | ||
| service: { | ||
| id: serviceResponse.id, | ||
| type: 'databaseService', | ||
| }, | ||
| sourceConfig: { | ||
| config: { | ||
| type: 'DatabaseMetadata', | ||
| }, | ||
| }, | ||
| }, | ||
| } | ||
| ); | ||
|
|
||
| expect(createPipelineResponse.status()).toBe(201); | ||
| const createdPipeline = await createPipelineResponse.json(); | ||
|
|
||
| await apiContext.post( | ||
| `/api/v1/services/ingestionPipelines/deploy/${createdPipeline.id}` | ||
| ); | ||
|
|
||
| slowTestPipeline = { | ||
| id: createdPipeline.id, | ||
| name: createdPipeline.name, | ||
| fullyQualifiedName: createdPipeline.fullyQualifiedName, | ||
| }; | ||
| }); | ||
|
|
||
| /** | ||
| * Validates that action buttons (logs, pause, run) are visible and functional | ||
| * even when the pipelineStatus API response is delayed (simulated via route mock). | ||
| * | ||
| * Regression test for the issue where high pipelineStatus API latency blocked | ||
| * rendering of action icons and the pause/resume button until the slow API resolved. | ||
| */ | ||
| test('Action buttons and pause visible when pipelineStatus API is slow', async ({ | ||
| page, | ||
| }) => { | ||
| test.slow(); | ||
|
|
||
| // Mock the pipelineStatus endpoint to simulate high latency | ||
| await page.route( | ||
| `**/api/v1/services/ingestionPipelines/${encodeURIComponent( | ||
| slowTestPipeline.fullyQualifiedName | ||
| )}/pipelineStatus**`, | ||
| async (route) => { | ||
| await page.waitForTimeout(8000); | ||
| await route.continue(); | ||
| } | ||
| ); | ||
|
|
||
| await visitServiceDetailsPage( | ||
| page, | ||
| { | ||
| type: slowPipelineService.category, | ||
| name: slowPipelineService.getServiceName(), | ||
| }, | ||
| false, | ||
| false | ||
| ); | ||
|
|
||
| await page.getByTestId('data-assets-header').waitFor(); | ||
| await page.getByTestId('agents').click(); | ||
|
|
||
| const metadataTab = page.locator('[data-testid="metadata-sub-tab"]'); | ||
| if (await metadataTab.isVisible()) { | ||
| await metadataTab.click(); | ||
| } | ||
|
|
||
| const pipelineRow = page.locator( | ||
| `[data-row-key*="${slowTestPipeline.name}"]` | ||
| ); | ||
|
|
||
| await expect(pipelineRow).toBeVisible({ timeout: 15000 }); | ||
|
|
||
| // Action buttons must be visible immediately — before the slow pipelineStatus | ||
| // API resolves — verifying permissions don't wait on run history | ||
| await expect(pipelineRow.getByTestId('pause-button')).toBeVisible({ | ||
| timeout: 5000, | ||
| }); | ||
|
|
||
| await expect(pipelineRow.getByTestId('logs-button')).toBeVisible({ | ||
| timeout: 5000, | ||
| }); | ||
|
|
||
| await expect(pipelineRow.getByTestId('more-actions')).toBeVisible({ | ||
| timeout: 5000, | ||
| }); | ||
|
|
||
| // Open the more-actions dropdown and verify the run button is present | ||
| await pipelineRow.getByTestId('more-actions').click(); | ||
| await expect(page.getByTestId('run-button')).toBeVisible({ | ||
| timeout: 5000, | ||
| }); | ||
|
|
||
| // Trigger a pipeline run via the run button | ||
| const triggerResponse = page.waitForResponse( | ||
| (res) => | ||
| res.url().includes('/services/ingestionPipelines/trigger/') && | ||
| res.request().method() === 'POST' | ||
| ); | ||
| await page.getByTestId('run-button').click(); | ||
| await triggerResponse; | ||
|
|
||
| // Verify the run was triggered by checking the pipeline row shows a running state | ||
| await expect( | ||
| pipelineRow.getByTestId('pipeline-status').first() | ||
| ).toBeVisible({ timeout: 15000 }); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in every step i see random timeout, what the reason of it, and do we even need it?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added this timeout is added because we need to check few things on UI after the api response came for the api for which we have increased the latency by mocking it. |
||
| }); | ||
| } | ||
| ); | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we are adding manual wait?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ShaileshParmar11 This timeout is added to increase the latency of that API to test few changes on UI.