det101 opened a new issue, #18646: URL: https://github.com/apache/dolphinscheduler/issues/18646
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar feature requirement. ### Description `DolphinDBDataSourceE2ETest` (and other datasource E2E cases that share `DataSourcePage#createDataSource`) intermittently fails in CI with: ```text org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":".dialog-create-data-source"} at DolphinDBDataSourceE2ETest.testCreateDolphinDBDataSource:... ``` Observed on PR E2E runs, e.g.: - https://github.com/apache/dolphinscheduler/actions/runs/35068266231/job/104706685281 - https://github.com/apache/dolphinscheduler/actions/runs/34825608630 (same stack / ~1.2–1.5s elapsed) This is unrelated to product features under test; it is a Selenium race in the shared page object. #### Root cause In `DataSourcePage.createDataSource`, after clicking the datasource type box, the wait eagerly resolves the element **before** `WebDriverWait`: ```java WebDriverWaitFactory.createWebDriverWait(driver).until(ExpectedConditions.textToBePresentInElement( driver.findElement(By.className("dialog-create-data-source")), dataSourceType.toUpperCase())); ``` `driver.findElement(...)` runs immediately (implicit wait is only ~1s in `DolphinSchedulerExtension`). If the create dialog is slightly slow to mount after the type click, the call throws `NoSuchElementException` and the 10s explicit wait never applies. The type-box lookup has a similar pattern (`By.className(...).findElement(driver)` without waiting for presence first). #### Proposed improvement Update `DataSourcePage#createDataSource` to locate via wait conditions that include presence, for example: 1. Wait for the type box with `ExpectedConditions.elementToBeClickable(By.className(type + "-box"))` instead of a bare `findElement`. 2. Replace `textToBePresentInElement(driver.findElement(...), ...)` with `textToBePresentInElementLocated(By.className("dialog-create-data-source"), type)`. This should reduce flaky failures for **all** datasource E2E tests that reuse `createDataSource` (MySQL / Postgres / Hive / SQL Server / ClickHouse / DolphinDB, etc.), without changing product code. #### Scope / non-goals - No change to datasource UI product behavior. - Optional follow-up: CI-level surefire rerun for E2E (broader; needs maintainer agreement). This issue focuses on the page-object wait fix. ### Are you willing to submit a PR? - [x] Yes I am willing to submit a PR! ### Code of Conduct - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
