GDGT-2793: Stabilize Python incremental transform test (#82423)
* GDGT-2793: Stabilize Python incremental transform test * GDGT-2793: Ground Python transform timeouts * GDGT-2793: Address PR comments
This commit is contained in:
@@ -6,6 +6,9 @@ const DB_NAME = "Writable Postgres12";
|
||||
const SOURCE_TABLE = "Animals";
|
||||
const TARGET_TABLE = "transform_table";
|
||||
const TARGET_SCHEMA = "Schema A";
|
||||
const TRANSFORM_DETAIL_TIMEOUT = 10_000;
|
||||
// Python runs asynchronously move data through S3 and an external runner before importing the result.
|
||||
const PYTHON_TRANSFORM_RUN_TIMEOUT = 20_000;
|
||||
|
||||
describe("scenarios > admin > transforms incremental", () => {
|
||||
beforeEach(() => {
|
||||
@@ -194,12 +197,19 @@ def transform(animals):
|
||||
cy.button("Save").click();
|
||||
cy.wait("@createTransform").then(({ response }) => {
|
||||
const transformId = response?.body?.id;
|
||||
if (transformId != null) {
|
||||
cy.wrap(transformId).as("transformId");
|
||||
}
|
||||
expect(response?.statusCode).to.equal(200);
|
||||
expect(transformId).to.be.a("number");
|
||||
});
|
||||
});
|
||||
|
||||
cy.location("pathname", { timeout: TRANSFORM_DETAIL_TIMEOUT }).should(
|
||||
"match",
|
||||
/^\/data-studio\/transforms\/\d+$/,
|
||||
);
|
||||
cy.findByTestId("transforms-header", {
|
||||
timeout: TRANSFORM_DETAIL_TIMEOUT,
|
||||
}).should("be.visible");
|
||||
|
||||
cy.log("run the transform and make sure its table can be queried");
|
||||
H.DataStudio.Transforms.runTab().click();
|
||||
runTransformAndWaitForSuccess();
|
||||
@@ -394,9 +404,11 @@ function visitTransformListPage() {
|
||||
return cy.visit("/data-studio/transforms");
|
||||
}
|
||||
|
||||
function runTransformAndWaitForSuccess() {
|
||||
function runTransformAndWaitForSuccess(
|
||||
options: { timeout?: number } = { timeout: PYTHON_TRANSFORM_RUN_TIMEOUT },
|
||||
) {
|
||||
getRunButton().click();
|
||||
getRunButton().should("have.text", "Ran successfully");
|
||||
getRunButton(options).should("have.text", "Ran successfully");
|
||||
}
|
||||
|
||||
function getRunButton(options: { timeout?: number } = {}) {
|
||||
|
||||
Reference in New Issue
Block a user