Inferensys

Prompt

Failover and Resilience Load Test Prompt

A practical prompt playbook for using Failover and Resilience Load Test Prompt in production AI workflows.
Operations team reviewing AI workflow automation on laptop, workflow builder visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Defines the job-to-be-done, ideal user, required context, and boundaries for the failover and resilience load test prompt.

This prompt is for SREs and performance engineers who need to validate high-availability configurations under load. It generates a detailed test scenario that combines steady-state traffic with controlled failure injections, failover timing expectations, and data consistency checks during the transition. Use this prompt when you have a defined HA architecture, a known traffic profile, and a list of failure modes you want to exercise. The output is a test plan, not a script. It is designed to be fed into a load testing tool configuration or used as a specification for a chaos engineering experiment.

Do not use this prompt if you lack architectural diagrams, monitoring definitions, or baseline performance data. The prompt assumes you can describe your system's components, their dependencies, and the expected failover mechanism. Before invoking it, gather your service topology, health-check configurations, client retry policies, and any known timing thresholds for leader election, DNS propagation, or connection draining. The prompt will ask you to specify these as [ARCHITECTURE_DESCRIPTION], [FAILURE_MODES], and [TRAFFIC_PROFILE] placeholders. If you cannot articulate how your system detects failure and what 'healthy' looks like for each component, the generated scenario will be speculative rather than actionable.

This prompt is most effective when you have already completed baseline performance characterization and bottleneck hypothesis generation. It builds on the assumption that you know your system's steady-state behavior and are now ready to test its behavior during degradation. The output will include explicit validation criteria—such as maximum acceptable failover time, zero data loss assertions, and consistency check queries—that you should wire into your test harness as pass/fail gates. If your goal is to discover unknown failure modes rather than validate known ones, start with a chaos engineering steady-state hypothesis prompt instead.

PRACTICAL GUARDRAILS

Use Case Fit

Where this prompt works and where it does not. Use these cards to decide if the Failover and Resilience Load Test Prompt fits your current testing context.

01

Good Fit: HA Configuration Validation

Use when: you have a deployed high-availability topology (active-passive, active-active, or multi-region) and need to validate that failover maintains data integrity and meets RTO/RPO targets under steady production-like load. Guardrail: ensure the prompt receives the specific HA architecture diagram and current health-check probe configurations as input.

02

Bad Fit: Component-Level Unit Resilience

Avoid when: you are testing a single service instance restart or a lone database connection retry. This prompt designs system-level failover scenarios, not isolated retry logic. Guardrail: redirect to a targeted fault-injection prompt for single-component testing before scaling up to this orchestrated scenario.

03

Required Inputs

What you must provide: the target system's HA topology, current health-check endpoints, expected failover trigger mechanisms, and the steady-state load profile to run during the transition. Guardrail: missing any of these inputs will cause the prompt to generate a generic scenario that skips critical timing and consistency checks specific to your infrastructure.

04

Operational Risk: Unplanned Failover Blind Spots

What to watch: the prompt may over-focus on planned, clean failover paths and under-represent unplanned, messy failures like split-brain scenarios or partial network partitions. Guardrail: explicitly request coverage of both planned maintenance failover and unplanned crash-failure paths in the scenario constraints.

05

Operational Risk: Data Consistency Check Gaps

What to watch: generated scenarios can emphasize timing and availability metrics while neglecting in-flight transaction consistency and idempotency verification. Guardrail: add explicit output requirements for data consistency validation steps, including checks for duplicate writes, lost acknowledgments, and out-of-order processing during the transition window.

06

Variant: Chaos Experiment Integration

Use when: you need to embed this failover scenario into a broader chaos engineering practice. Guardrail: adapt the prompt to include a steady-state hypothesis definition, blast radius constraints, and an explicit abort condition tied to a critical user-facing SLO breach before generating the injection steps.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template for generating a failover and resilience load test scenario with controlled failure injections and validation criteria.

This prompt template is designed to be copied directly into your prompt engineering environment or AI harness. It instructs the model to produce a detailed, executable failover and resilience load test scenario. The template uses square-bracket placeholders for all system-specific details, such as your architecture, failure modes, and acceptance criteria. Replace each placeholder with concrete values from your system's design documents, runbooks, and SLOs before sending the prompt to the model.

text
You are a senior Site Reliability Engineer designing a failover and resilience load test.

Your task is to produce a complete test scenario that combines steady production-representative traffic with controlled failure injections. The scenario must validate both planned and unplanned failover paths, measure recovery timing, and check data consistency during the transition.

## SYSTEM CONTEXT
- Architecture Description: [SYSTEM_ARCHITECTURE_DESCRIPTION]
- High-Availability Configuration: [HA_CONFIGURATION_DETAILS]
- Component Dependency Map: [COMPONENT_DEPENDENCY_MAP]
- Data Consistency Requirements: [DATA_CONSISTENCY_REQUIREMENTS]

## TRAFFIC PROFILE
- Steady-State Load Model: [STEADY_STATE_LOAD_MODEL]
- Request Mix and Throughput Targets: [REQUEST_MIX_AND_THROUGHPUT]
- User Journey Scripts: [USER_JOURNEY_SCRIPTS]

## FAILURE INJECTIONS
- Planned Failover Triggers: [PLANNED_FAILOVER_TRIGGERS]
- Unplanned Failure Scenarios: [UNPLANNED_FAILURE_SCENARIOS]
- Network Partition or Latency Injection Parameters: [NETWORK_INJECTION_PARAMETERS]
- Resource Exhaustion Scenarios: [RESOURCE_EXHAUSTION_SCENARIOS]

## ACCEPTANCE CRITERIA
- Maximum Acceptable Failover Time (seconds): [MAX_FAILOVER_TIME]
- Allowed Error Budget Consumption: [ERROR_BUDGET_CONSUMPTION]
- Data Consistency Check Queries: [DATA_CONSISTENCY_CHECKS]
- Required Monitoring Signals: [MONITORING_SIGNALS]

## CONSTRAINTS
- Blast Radius Limits: [BLAST_RADIUS_LIMITS]
- Safe Abort Conditions: [SAFE_ABORT_CONDITIONS]
- Environment Restrictions: [ENVIRONMENT_RESTRICTIONS]

## OUTPUT SCHEMA
Produce a JSON object with the following structure:
{
  "scenario_name": "string",
  "objectives": ["string"],
  "preconditions": {
    "system_state": "string",
    "monitoring_readiness": ["string"],
    "rollback_plan": "string"
  },
  "load_phase": {
    "ramp_up_minutes": number,
    "steady_state_duration_minutes": number,
    "traffic_profile": {
      "requests_per_second": number,
      "write_percentage": number,
      "read_percentage": number,
      "key_endpoints": ["string"]
    }
  },
  "failure_injections": [
    {
      "injection_name": "string",
      "injection_time_seconds": number,
      "failure_type": "planned_failover | unplanned_crash | network_partition | resource_exhaustion",
      "target_component": "string",
      "injection_command_or_method": "string",
      "expected_blast_radius": "string"
    }
  ],
  "observations": [
    {
      "observation_name": "string",
      "metric_or_log_query": "string",
      "expected_behavior": "string",
      "failure_indicator": "string"
    }
  ],
  "data_consistency_checks": [
    {
      "check_name": "string",
      "query_or_procedure": "string",
      "expected_result": "string",
      "timing_relative_to_injection_seconds": number
    }
  ],
  "success_criteria": {
    "max_failover_time_seconds": number,
    "max_error_rate_percent": number,
    "data_consistency_required": boolean,
    "all_monitoring_alerts_triggered": boolean
  },
  "abort_conditions": ["string"],
  "risks_and_assumptions": ["string"]
}

## INSTRUCTIONS
1. Design the scenario so that steady traffic continues during the entire failover sequence.
2. Include at least one planned failover and one unplanned failure injection.
3. Specify exact monitoring queries that will confirm failover completion and data consistency.
4. Define clear abort conditions that prevent cascading failures beyond the blast radius.
5. Note any assumptions about the system state or configuration that could invalidate the test.

After copying the template, replace each placeholder with values from your system's architecture diagrams, runbooks, and SLO documents. The [SYSTEM_ARCHITECTURE_DESCRIPTION] should include component names, data flow directions, and redundancy mechanisms. For [FAILURE_INJECTION_PARAMETERS], be specific about the tooling you will use (e.g., Chaos Mesh, Gremlin, AWS Fault Injection Service) and the exact commands or API calls. The output schema is designed to be directly consumed by a test orchestration harness, so ensure all timing values and metric queries are machine-readable. Before executing the generated scenario, have a second SRE review the blast radius limits and abort conditions to confirm they match your environment's safety constraints.

IMPLEMENTATION TABLE

Prompt Variables

Required inputs for the Failover and Resilience Load Test Prompt. Each placeholder must be populated before the prompt is sent to the model. Missing or invalid inputs will produce unreliable test scenarios.

PlaceholderPurposeExampleValidation Notes

[SYSTEM_ARCHITECTURE]

Describes the HA topology, including primary/standby nodes, load balancers, and data replication paths

Active-passive PostgreSQL cluster with pgpool-II load balancer, streaming replication to one standby in same AZ

Must include component roles, replication mechanism, and quorum configuration if applicable. Reject if only service names are provided without topology relationships.

[FAILURE_INJECTION_POINTS]

List of components or network paths where failures will be injected during the test

Primary database node, load balancer health check endpoint, cross-AZ network link between primary and standby

Each entry must specify a concrete component or path. Reject generic entries like 'database' or 'network'. Validate against [SYSTEM_ARCHITECTURE] for existence.

[STEADY_STATE_LOAD_PROFILE]

The baseline traffic pattern applied before and during failover, including request mix and throughput

500 req/s mixed read/write (80/20), 200 concurrent connections, average payload 4KB, p99 latency target 200ms

Must include throughput, concurrency, and latency targets. Reject if only endpoint names are listed without numeric targets.

[FAILOVER_TIMING_BUDGET]

Acceptable time windows for failover detection, initiation, and completion

Detection: 5s, failover initiation: 2s, standby promotion: 10s, total recovery time objective (RTO): 30s

Each timing value must have a unit. Total RTO must be stated. Reject if detection time exceeds total RTO.

[DATA_CONSISTENCY_REQUIREMENTS]

Expected data durability and consistency guarantees during and after failover

Zero data loss (RPO=0), read-after-write consistency post-failover, no duplicate transactions

Must specify RPO and post-failover consistency model. Reject if RPO is stated without the consistency check method.

[MONITORING_SIGNALS]

Metrics, logs, and alerts used to observe system behavior during the test

Replication lag seconds, connection pool utilization, transaction commit rate, load balancer health check status, application error rate by type

Each signal must be observable during the test. Reject if a signal cannot be collected from the described architecture.

[PLANNED_FAILOVER_PATH]

The expected sequence when failover is triggered intentionally via operational procedure

Manual pgpool detach primary, promote standby, update DNS, drain old primary connections, verify replication direction

Must describe an ordered sequence. Reject if the path skips verification steps or assumes zero-downtime without justification.

[UNPLANNED_FAILOVER_PATH]

The expected sequence when the primary fails without warning

Health check timeout triggers standby promotion, application retries with exponential backoff, stale connection cleanup, alert fired if promotion exceeds 15s

Must include automatic detection trigger and application-side recovery behavior. Reject if only infrastructure steps are listed without client impact.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the failover and resilience load test prompt into an automated testing pipeline with validation, retries, and human review gates.

This prompt is designed to be a planning and design artifact, not a direct executor. The primary integration point is a test planning pipeline where an SRE or performance engineer provides system architecture details, HA configuration, and failure injection constraints, and the prompt returns a structured test scenario document. The output should be treated as a human-reviewed specification before any load generation tool (k6, Locust, JMeter, Gatling) or chaos engineering platform (Gremlin, Chaos Mesh, Litmus) executes the scenario. Because failover tests carry inherent risk of production-impacting side effects, the harness must enforce a manual approval step between scenario generation and execution.

Integration workflow: (1) Collect inputs from your service catalog, runbooks, and HA configuration files into the [SYSTEM_ARCHITECTURE], [HA_CONFIGURATION], and [FAILURE_INJECTION_CONSTRAINTS] placeholders. (2) Submit the prompt to a model with strong reasoning capabilities (Claude 3.5 Sonnet or GPT-4o) with temperature set to 0.2–0.4 to balance creativity in failure scenario design with consistency. (3) Parse the output against the [OUTPUT_SCHEMA] using a JSON schema validator. If validation fails, retry once with the validation error injected into the [CONSTRAINTS] field. If it fails twice, escalate to a human with the raw output and error log. (4) Route the validated scenario to a review queue where an SRE must approve the failure injection plan, blast radius, and abort conditions before any automation executes it. (5) After approval, transform the scenario into tool-specific configuration (e.g., k6 test script, Gremlin experiment definition) using a separate translation step—do not ask the LLM to generate executable scripts directly.

Critical safety checks: Before execution, the harness must verify that the generated scenario includes explicit abort conditions, a defined blast radius, and expected failover timing thresholds. If any of these are missing or ambiguous, the scenario must be rejected regardless of schema validity. Log every generation attempt, validation result, and human approval decision for auditability. For high-risk environments (production, revenue-critical systems), require two-person approval. Never allow automated execution of a generated failover scenario without these gates—this is the single most important rule in the harness.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the required fields, types, and validation rules for the failover and resilience load test scenario output. Use this contract to parse, validate, and integrate the generated scenario into your test harness.

Field or ElementType or FormatRequiredValidation Rule

scenario_name

string

Must be non-empty and contain the failure type and target component (e.g., 'primary_db_pod_delete')

steady_state_load

object

Must contain 'requests_per_second' (integer > 0) and 'duration_seconds' (integer >= 300) before failure injection

failure_injection

object

Must contain 'target_component' (string), 'failure_type' (enum: POD_DELETE, NETWORK_LATENCY, PROCESS_KILL, PACKET_LOSS), and 'injection_command' (string)

failover_timing_expectations

object

Must contain 'max_detection_seconds' (integer), 'max_failover_seconds' (integer), and 'max_total_impact_seconds' (integer). All values must be positive.

data_consistency_checks

array

Each element must be an object with 'check_description' (string), 'query_or_command' (string), and 'expected_result' (string). Array must not be empty.

monitoring_metrics

array

Each element must be an object with 'metric_name' (string), 'query_or_endpoint' (string), and 'pass_condition' (string). Must include at least error_rate, latency_p99, and request_throughput.

rollback_plan

string

Must describe the steps to restore the system to its pre-test state. Null or empty string is not allowed.

abort_conditions

array

Each element must be a string describing a condition that triggers immediate test termination. Must include at least one condition related to data corruption or unrecoverable state.

PRACTICAL GUARDRAILS

Common Failure Modes

Failover and resilience load tests are complex because they combine steady-state traffic with controlled failure injections. These are the most common failure modes in prompt design and test execution, along with practical mitigations.

01

Unrealistic Steady-State Traffic

What to watch: The prompt generates a load profile that doesn't match production traffic patterns—wrong request mix, missing endpoints, or uniform think times that hide real bottlenecks. The failover test passes but production fails because the baseline wasn't representative. Guardrail: Always provide the prompt with a production traffic sample or SLA-derived workload model. Validate the generated load profile against real trace data before injecting failures.

02

Missing Failure Injection Scope

What to watch: The prompt produces a scenario that injects failures too broadly (entire region down) or too narrowly (single pod restart) without matching the actual resilience design. Tests pass because they don't exercise the real failure domains. Guardrail: Explicitly define failure boundaries in the prompt—specify which components, at what layer, and whether the injection is graceful or abrupt. Include both planned (rolling restart) and unplanned (kill -9) failure modes.

03

Vague Failover Timing Expectations

What to watch: The prompt generates a scenario with ambiguous timing—'traffic should recover quickly' instead of concrete thresholds for detection time, failover completion, and session reconnection. Results become unverifiable. Guardrail: Require the prompt to produce specific timing budgets per failover phase: failure detection window, traffic cutover latency, and full recovery deadline. Tie each threshold to a monitoring metric that can be measured during the test.

04

Ignoring Data Consistency During Transition

What to watch: The prompt focuses entirely on availability metrics (error rate, latency) and omits data integrity checks—in-flight transactions, partially written records, or stale reads during the failover window. The test passes but data corruption goes undetected. Guardrail: Add explicit data consistency validation steps to the prompt: compare pre-failover and post-failover state, check for duplicate or missing records, and verify that idempotency keys survive the transition.

05

Single-Failure Blindness

What to watch: The prompt designs a scenario around one clean failure at a time, missing compound failure modes like a dependency degrading during failover or a monitoring system becoming unavailable simultaneously. Production incidents rarely arrive alone. Guardrail: Instruct the prompt to include at least one compound failure scenario—such as increased latency on a dependency while the primary database fails over—and validate that the system's fallback and timeout configurations handle the overlap.

06

No Rollback or Abort Criteria

What to watch: The prompt produces a test that runs to completion regardless of system state, with no defined conditions for aborting the test if the system enters an unrecoverable state. This risks extended outages during testing. Guardrail: Require the prompt to define explicit abort thresholds—error rate ceilings, latency floors, or data loss indicators—that trigger automatic test termination and rollback. Include human-approval checkpoints before destructive failure injections.

IMPLEMENTATION TABLE

Evaluation Rubric

Criteria for evaluating the quality and safety of a generated failover and resilience load test scenario before executing it in a staging or production environment.

CriterionPass StandardFailure SignalTest Method

Steady-State Definition

Scenario explicitly defines a measurable 'normal' state with specific metric thresholds (e.g., p95 latency < 200ms, error rate < 0.1%) before any failure is injected.

The prompt output describes the failure injection but omits a quantifiable pre-failure baseline. Vague terms like 'normal load' are used without metrics.

Schema check: Verify the [STEADY_STATE] block contains at least one numeric metric and threshold. Parse check: Confirm metrics are not null.

Failure Injection Specificity

The scenario specifies at least one concrete failure mode (e.g., 'kill primary database node', 'inject 5s latency on payment service') with a clear injection method and target.

The output uses generic language like 'simulate a failure' or 'test resilience' without naming a specific component, action, or duration.

Keyword check: Search for injection commands (e.g., 'kill', 'terminate', 'iptables', 'tc', 'latency injection'). Schema check: [FAILURE_INJECTIONS] array is not empty.

Failover Timing Contract

The scenario defines explicit expected recovery time objectives (RTO) and recovery point objectives (RPO) or a clear maximum allowed disruption window (e.g., 'traffic should fail over within 30 seconds').

The output lacks any timing expectation or uses an unbounded statement like 'system should recover quickly'. No RTO/RPO or max disruption window is defined.

Schema check: Verify [FAILOVER_EXPECTATIONS] contains a numeric max_disruption_seconds or rto_seconds field. Parse check: Value is a positive integer.

Data Consistency Check

The scenario includes a post-failover validation step to check for data loss or corruption, such as row counts, checksum comparisons, or idempotency key verification.

The scenario only checks if the service is 'up' after failover (e.g., HTTP 200 OK) without verifying data integrity or state consistency.

Keyword check: Search for 'consistency', 'checksum', 'row count', 'data integrity', or 'idempotency'. Schema check: [POST_FAILOVER_VALIDATION] block is present and not null.

Blast Radius Containment

The scenario defines a blast radius (e.g., a single availability zone, a specific service instance) and includes an abort condition to stop the test if the blast radius is exceeded.

The scenario proposes a cluster-wide failure without scoping the impact or lacks a defined 'stop' condition, risking a full production outage.

Schema check: Verify [BLAST_RADIUS] has a non-null scope field. Parse check: [ABORT_CONDITIONS] array contains at least one condition based on an error budget or health check.

Planned vs. Unplanned Path Coverage

The scenario covers both a graceful, planned failover (e.g., draining a node) and a sudden, unplanned failure (e.g., a process crash) to validate different code paths.

The scenario only tests one failover type, typically a clean 'stop' command, missing the more chaotic unplanned failure path.

Logical check: Count distinct failure types in [FAILURE_INJECTIONS]. A passing scenario has at least one entry with type: 'planned' and one with type: 'unplanned'.

Observability Signal Mapping

The scenario maps each failure injection to specific observability signals (metrics, logs, alerts) that should fire, change, or remain stable during the test.

The output lists generic monitoring tools (e.g., 'check Grafana') without specifying which dashboards, metrics, or log queries to validate during the failover.

Schema check: Each item in [FAILURE_INJECTIONS] has a non-empty observability_signals array. Parse check: Each signal has a query or metric_name field.

Rollback and Cleanup Procedure

The scenario includes explicit steps to remove latency injections, restart killed components, and restore the system to its pre-test state after the test concludes or aborts.

The output describes how to start the test but provides no cleanup or rollback instructions, leaving the system in a potentially degraded state.

Keyword check: Search for 'cleanup', 'rollback', 'restore', or 'reset'. Schema check: [CLEANUP_PROCEDURE] block is present and contains a non-empty list of steps.

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a single failure injection and relaxed timing expectations. Replace [FAILURE_INJECTION_PLAN] with one controlled fault (e.g., kill one pod). Set [DATA_CONSISTENCY_CHECKS] to a simple row-count comparison. Run against a staging environment without strict SLA gates.

Watch for

  • Missing failover timing instrumentation
  • Overly broad pass/fail criteria that hide partial degradation
  • No baseline steady-state measurement before injection
Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.