bbovenzi commented on code in PR #64540:
URL: https://github.com/apache/airflow/pull/64540#discussion_r3017704267


##########
airflow-core/src/airflow/ui/tests/e2e/utils/test-helpers.ts:
##########
@@ -569,7 +580,7 @@ export async function apiCancelBackfill(source: 
RequestLike, backfillId: number)
   const request = getRequestContext(source);
 
   const response = await 
request.put(`${baseUrl}/api/v2/backfills/${backfillId}/cancel`, {
-    timeout: 30_000,
+    timeout: 10_000,

Review Comment:
   I wonder if we should make this a reshared constant variable



##########
airflow-core/src/airflow/ui/tests/e2e/utils/test-helpers.ts:
##########
@@ -497,29 +497,40 @@ export async function apiDeleteDagRun(source: 
RequestLike, dagId: string, runId:
  * Delete a DAG run, logging (not throwing) unexpected errors.
  * Use this in fixture teardown where cleanup must not abort the loop.
  * 404 is already handled inside `apiDeleteDagRun`.
- * 409 (running state) is handled by force-failing the run first, then 
retrying.
+ *
+ * Strategy: force-fail the run first so the server doesn't wait for
+ * running tasks during deletion, then delete with one retry on timeout.
  */
 export async function safeCleanupDagRun(source: RequestLike, dagId: string, 
runId: string): Promise<void> {
+  const request = getRequestContext(source);
+
   try {
-    await apiDeleteDagRun(source, dagId, runId);
-  } catch (error) {
-    const message = error instanceof Error ? error.message : String(error);
-
-    // 409 = DAG run is still running — force-fail, then retry deletion.
-    if (message.includes("409")) {
-      try {
-        await apiSetDagRunState(source, { dagId, runId, state: "failed" });

Review Comment:
   Or why did we have a separate dag run state function to being with?



##########
airflow-core/src/airflow/ui/tests/e2e/utils/test-helpers.ts:
##########
@@ -497,29 +497,40 @@ export async function apiDeleteDagRun(source: 
RequestLike, dagId: string, runId:
  * Delete a DAG run, logging (not throwing) unexpected errors.
  * Use this in fixture teardown where cleanup must not abort the loop.
  * 404 is already handled inside `apiDeleteDagRun`.
- * 409 (running state) is handled by force-failing the run first, then 
retrying.
+ *
+ * Strategy: force-fail the run first so the server doesn't wait for
+ * running tasks during deletion, then delete with one retry on timeout.
  */
 export async function safeCleanupDagRun(source: RequestLike, dagId: string, 
runId: string): Promise<void> {
+  const request = getRequestContext(source);
+
   try {
-    await apiDeleteDagRun(source, dagId, runId);
-  } catch (error) {
-    const message = error instanceof Error ? error.message : String(error);
-
-    // 409 = DAG run is still running — force-fail, then retry deletion.
-    if (message.includes("409")) {
-      try {
-        await apiSetDagRunState(source, { dagId, runId, state: "failed" });

Review Comment:
   What happened to deleting the dagrunstate?



-- 
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]

Reply via email to