Phase 1


v3.1 - Test cases: Synchronous DAG Execution (Streaming Endpoint)

Test Case ID

Test Objective

Test Steps

Expected Outcome

Test Type

TC-001

Validate streaming DAG run endpoint with successful completion

1. Set up a simple DAG with 2-3 tasks 2. Trigger the DAG run via API 3. Call GET /api/v2/dags/{dag_id}/dagRuns/{run_id}/watch 4. Observe streaming JSON responses 5. Wait for DAG to complete successfully

Endpoint streams JSON objects at intervals showing DAG state progression from "running" to "success", stream terminates when DAG completes

Positive

TC-002

Verify streaming endpoint handles DAG failure correctly

1. Create a DAG with a task designed to fail 2. Trigger the DAG run 3. Call GET /api/v2/dags/{dag_id}/dagRuns/{run_id}/watch 4. Monitor streaming responses until failure occurs

Endpoint streams state updates, returns "failed" state when DAG fails, stream terminates appropriately with failure details

Positive

TC-003

Test streaming endpoint with custom polling interval

1. Trigger a long-running DAG (>30 seconds) 2. Call GET /api/v2/dags/{dag_id}/dagRuns/{run_id}/watch?interval=5 3. Measure time between consecutive streamed responses 4. Verify interval consistency

JSON objects are emitted every 5 seconds (specified interval) until DAG completion

Positive

TC-004

Validate XCom inclusion in streaming response

1. Create DAG with task that returns XCom values 2. Trigger the DAG run 3. Call GET /api/v2/dags/{dag_id}/dagRuns/{run_id}/watch?include_xcom=true 4. Wait for DAG completion 5. Inspect final response

Final streaming response includes XCom data from completed tasks in the JSON payload

Positive

TC-005

Handle non-existent DAG run ID in streaming endpoint

1. Call GET /api/v2/dags/valid_dag_id/dagRuns/non_existent_run_id/watch 2. Verify error response format 3. Check HTTP status code

Returns HTTP 404 error with message: "DAG run not found"

Negative

TC-006

Handle non-existent DAG ID in streaming endpoint

1. Call GET /api/v2/dags/non_existent_dag/dagRuns/valid_run_id/watch 2. Verify error response format 3. Check HTTP status code

Returns HTTP 404 error with message: "DAG not found"

Negative

TC-007

Test streaming endpoint with already completed DAG run

1. Trigger a DAG and wait for it to complete fully 2. Call GET /api/v2/dags/{dag_id}/dagRuns/{run_id}/watch on the completed run 3. Observe response behavior

Immediately returns the final state (success/failed) without streaming, since DAG is already finished

Edge

TC-008

Verify streaming endpoint timeout behavior

1. Set up long-running DAG (>5 minutes) 2. Call streaming endpoint 3. Simulate client timeout or connection interruption 4. Attempt to reconnect

Connection handles timeout gracefully, new request can resume monitoring from current state

Edge

TC-009

Test concurrent streaming requests for same DAG run

1. Trigger a DAG run 2. Open 3 simultaneous streaming connections to the same DAG run 3. Monitor all streams until completion 4. Verify data consistency

All streams receive identical state updates at the same intervals, all terminate simultaneously when DAG completes

Positive

TC-010

Validate streaming with DAG run in queued state

1. Configure Airflow to limit concurrent DAG runs 2. Queue multiple DAG runs to create backlog 3. Call streaming endpoint on queued DAG run 4. Monitor state progression

Stream initially shows "queued" state, transitions to "running" when execution starts, continues until completion

Positive

TC-011

Test streaming endpoint parameter validation

1. Call GET /api/v2/dags/{dag_id}/dagRuns/{run_id}/watch?interval=invalid_value 2. Try negative interval values 3. Try non-numeric interval values 4. Try include_xcom with invalid values

Returns HTTP 400 with appropriate validation error messages for invalid parameters

Negative

TC-012

Verify streaming endpoint with DAG containing sensors

1. Create DAG with FileSensor or other sensor operator 2. Trigger DAG run 3. Call streaming endpoint 4. Simulate sensor condition fulfillment 5. Monitor state changes

Stream shows "running" state during sensor wait period, progresses to next task when sensor condition is met

Edge

TC-013

Test streaming endpoint authorization with RBAC

1. Login as user without DAG read permissions 2. Attempt to call GET /api/v2/dags/protected_dag/dagRuns/{run_id}/watch 3. Verify access control enforcement

Returns HTTP 403: "Permission denied" for unauthorized DAG access

Negative

TC-014

Validate streaming response JSON schema consistency

1. Trigger multiple different DAGs with varying complexities 2. Monitor streaming endpoints for each 3. Parse and validate each JSON response 4. Check required fields presence

All streamed JSON objects follow consistent schema with fields: state, run_id, dag_id, start_date, end_date, logical_date

Positive

TC-015

Test streaming endpoint with task retries

1. Create DAG with task configured for 2 retries and designed to fail initially 2. Trigger DAG run 3. Monitor via streaming endpoint through task retries 4. Observe state changes during retry cycles

Stream correctly shows task retry attempts, state remains "running" during retries, progresses appropriately after final attempt

Edge

TC-016

Verify streaming endpoint handles DAG with skipped tasks

1. Create DAG with BranchPythonOperator that skips certain tasks 2. Trigger DAG run 3. Monitor via streaming endpoint 4. Wait for completion

Stream shows "running" state, completes with "success" even when some tasks are skipped, final state reflects overall DAG success

Edge

TC-017

Test streaming endpoint network connection limits

1. Open maximum allowed concurrent streaming connections 2. Attempt to open additional connection beyond limit 3. Monitor server behavior and resource usage

Server handles connection limit gracefully, returns appropriate error for excessive connections or queues requests appropriately

Edge

TC-018

Validate experimental endpoint documentation

1. Check OpenAPI specification for the streaming endpoint 2. Verify endpoint is marked as experimental 3. Review response headers for experimental indicators 4. Confirm API documentation warnings

Endpoint clearly marked as "experimental" in API docs, OpenAPI spec, and response headers include experimental status

Positive

TC-019

Test streaming endpoint with very short DAG execution

1. Create DAG with single task that completes in <1 second 2. Trigger DAG run 3. Call streaming endpoint immediately 4. Verify response handling

Stream may show only final completed state, or brief "running" followed by "success", handles rapid state changes correctly

Edge

TC-020

Verify streaming endpoint cleanup and resource management

1. Monitor multiple streaming endpoints 2. Check server resource usage (memory, connections) 3. Force-close client connections 4. Verify server-side cleanup

Server properly cleans up streaming resources when clients disconnect, no memory leaks or orphaned connections

Edge

  • No labels