Inferensys

Prompt

Soak Test Scenario Construction Prompt

A practical prompt playbook for using the Soak Test Scenario Construction Prompt in production AI workflows to generate long-running stability test plans.
Operations team reviewing AI workflow automation on laptop, workflow builder visible, casual office setup.
PROMPT PLAYBOOK

When to Use This Prompt

Define the reliability engineering job, required inputs, and when this prompt is the wrong tool.

This prompt is for reliability engineers and SREs who need to design a long-running soak test scenario before writing a single line of test script. The job-to-be-done is converting a system's steady-state architecture, known resource limits, and slow-burn failure hypotheses into a concrete, executable test plan. You should use this prompt when you have a clear picture of the target service's normal load profile, its memory and connection pool configurations, and the specific degradation signals you want to monitor over an extended period (typically 6–72 hours). The ideal user brings a service map, recent resource dashboards, and a list of suspected leak or accumulation risks—this prompt will not invent those from scratch.

Do not use this prompt for spike testing, breakpoint discovery, or capacity planning. Those scenarios require different load profiles (rapid ramp, graduated overload, or growth projections) that this prompt's steady-state focus will not produce. Also avoid this prompt if you lack baseline metrics for the target environment; the output requires concrete thresholds for memory growth rate, disk accumulation, and connection count trends. If you feed it vague inputs like 'test for memory issues,' the generated scenario will be too generic to catch the slow-burn failures that distinguish soak tests from shorter-duration performance runs. The prompt assumes you already understand the difference between a memory leak and high baseline memory usage—it will not teach you reliability engineering fundamentals.

This prompt works best when paired with a monitoring harness that can collect the specified trend metrics over the full test duration. Before using the output, validate that your observability stack can track the exact indicators the scenario requests (e.g., heap size delta per hour, file descriptor count slope, connection pool wait time drift). If your monitoring cannot capture these signals at the required granularity, fix that gap first. The scenario will include checkpoints and abort conditions; wire those into your test orchestration so the soak test stops automatically if a threshold is breached, rather than running blind for hours. For high-risk production-facing services, add a human approval gate before starting any soak test that shares infrastructure with live traffic.

After generating the scenario, review the resource trend monitoring criteria against your actual service limits. The prompt will produce thresholds based on the inputs you provide, but it cannot know about undocumented limits or recent config changes. If the output suggests a memory leak threshold of 50MB/hour but your service typically grows 30MB/hour under normal operation, adjust the threshold before execution. The scenario is a starting point for your test design, not a final runbook. Use it to structure your thinking about what 'stable' means for this specific service over time, then adapt the checkpoints and durations to your operational reality.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Soak Test Scenario Construction Prompt works well and where it introduces risk. Use these cards to decide if this prompt fits your current reliability testing workflow.

01

Good Fit: Long-Running Stability Validation

Use when: you need to validate memory, connection pools, and disk usage over 12–72+ hours under steady load. Guardrail: pair the generated scenario with explicit resource trend thresholds (e.g., RSS growth < 5%/hr) so the test fails on slow leaks, not just crashes.

02

Good Fit: Pre-Release Reliability Gate

Use when: a release candidate must pass a multi-hour soak before production promotion. Guardrail: require the prompt to output a go/no-go checklist tied to specific metrics (GC pause frequency, file descriptor count, log growth rate) rather than a vague stability claim.

03

Bad Fit: Spike or Burst Testing

Avoid when: you need to test sudden traffic spikes, flash sales, or rapid scale-up events. Soak tests model steady-state degradation, not transient overload. Guardrail: use the Peak Traffic Simulation or Stress Test Breakpoint prompts for burst scenarios instead.

04

Bad Fit: Functional Correctness Verification

Avoid when: you need to verify business logic, API contracts, or data integrity rules. Soak tests check for degradation over time, not correctness of individual responses. Guardrail: run a functional regression suite before the soak test; the soak scenario should assume correctness and focus on stability.

05

Required Input: Production Traffic Baseline

Risk: without real traffic shape data, the generated load profile may miss the request mix that actually causes slow leaks. Guardrail: provide at least 24 hours of production RPS, endpoint mix, and payload size distributions as [INPUT]. If unavailable, flag the scenario as synthetic and increase monitoring sensitivity.

06

Operational Risk: Environment Drift During Long Runs

Risk: log rotation, backup jobs, or cluster auto-scaling events during a 48-hour soak can create false positives or mask real leaks. Guardrail: the prompt should include instructions to document expected background operations and exclude their impact windows from threshold evaluation, or schedule the soak to overlap with known maintenance periods intentionally.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template for constructing a soak test scenario with placeholders for system context, risk profile, and output schema.

The following prompt template is designed to be copied directly into your AI harness, notebook, or prompt management system. It uses square-bracket placeholders for all dynamic inputs—system architecture details, known risk areas, monitoring stack, and the required output format. Replace each placeholder with concrete values before execution. The prompt instructs the model to act as a reliability engineer constructing a long-running stability test, focusing on slow-burn failure modes like memory leaks, connection pool exhaustion, and disk accumulation rather than immediate breakpoints.

text
You are a senior reliability engineer designing a long-duration soak test to validate system stability under sustained load.

Your task is to produce a complete soak test scenario based on the provided system context, risk profile, and monitoring capabilities.

## SYSTEM CONTEXT
[SYSTEM_ARCHITECTURE_DESCRIPTION]

## KNOWN RISK AREAS
[KNOWN_RISK_AREAS_AND_PAST_INCIDENTS]

## MONITORING STACK
[MONITORING_TOOLS_AND_AVAILABLE_METRICS]

## TARGET DURATION
[TARGET_SOAK_DURATION_HOURS]

## CONSTRAINTS
[ENVIRONMENT_CONSTRAINTS_AND_LIMITS]

## OUTPUT SCHEMA
Produce a JSON object with the following structure:
{
  "scenario_name": "string",
  "steady_state_load_profile": {
    "total_throughput_target": "number (requests/second)",
    "request_mix": [
      {
        "endpoint_or_operation": "string",
        "percentage_of_traffic": "number",
        "payload_profile": "string (description of typical payload size and shape)"
      }
    ],
    "ramp_up_period_minutes": "number",
    "steady_state_duration_hours": "number",
    "ramp_down_period_minutes": "number"
  },
  "slow_burn_failure_hypotheses": [
    {
      "failure_mode": "string (e.g., memory leak, connection pool leak, disk accumulation, thread starvation)",
      "affected_component": "string",
      "detection_metric": "string (specific metric name from monitoring stack)",
      "degradation_threshold": "string (value or trend that indicates a problem)",
      "expected_time_to_surface_hours": "number"
    }
  ],
  "resource_trend_monitoring": [
    {
      "resource": "string (CPU, memory, disk, file descriptors, connections, etc.)",
      "component": "string",
      "baseline_start_value": "string (expected value at test start)",
      "maximum_acceptable_growth_rate": "string (e.g., +5MB/hour, +10 connections/hour)",
      "alert_threshold": "string"
    }
  ],
  "log_rotation_checkpoints": [
    {
      "log_source": "string",
      "check_interval_hours": "number",
      "expected_rotation_behavior": "string",
      "failure_indicator": "string (what to look for if rotation fails)"
    }
  ],
  "data_accumulation_checks": [
    {
      "data_store": "string (database table, queue, filesystem path)",
      "expected_growth_pattern": "string",
      "cleanup_mechanism": "string (what should prevent unbounded growth)",
      "warning_threshold": "string"
    }
  ],
  "pass_criteria": [
    "string (specific, measurable condition that must hold for the test to pass)"
  ],
  "abort_conditions": [
    "string (condition that triggers immediate test termination)"
  ]
}

## INSTRUCTIONS
1. Use the SYSTEM CONTEXT to identify components most likely to exhibit slow-burn failures.
2. Cross-reference KNOWN RISK AREAS to ensure past incident patterns are covered.
3. Only reference metrics that exist in the MONITORING STACK.
4. Set degradation thresholds conservatively—soak tests catch trends, not spikes.
5. Include at least one hypothesis for memory, one for connections, and one for disk or data accumulation.
6. If any required field cannot be determined from the provided context, set its value to null and add an entry to an "assumptions" array explaining what additional information is needed.

To adapt this template, replace each square-bracket placeholder with concrete values from your system. The [SYSTEM_ARCHITECTURE_DESCRIPTION] should include service names, data stores, connection pools, and any known resource limits. The [KNOWN_RISK_AREAS_AND_PAST_INCIDENTS] field is critical—soak tests are most valuable when they target failure modes that have already caused outages. If you lack historical incident data, describe the components you suspect are least tested under sustained load. The output schema enforces a structured JSON response suitable for direct ingestion into a test automation harness or runbook. Before executing the generated scenario in production-like environments, validate that every detection metric referenced in the hypotheses actually exists in your monitoring stack and that abort conditions are wired to automated kill switches.

IMPLEMENTATION TABLE

Prompt Variables

Required and optional inputs for the Soak Test Scenario Construction Prompt. Each placeholder must be populated with concrete values to produce a reliable, executable soak test plan.

PlaceholderPurposeExampleValidation Notes

[SYSTEM_ARCHITECTURE]

Describes the components, services, and data stores under test

Microservices: API Gateway, User Service (PostgreSQL), Order Service (PostgreSQL), Inventory Service (Redis). Message bus: Kafka. All in Kubernetes.

Must include at least one stateful component. Check for missing persistence layers or connection pool boundaries.

[STEADY_STATE_LOAD_PROFILE]

Defines the normal operating traffic to sustain during the soak

500 req/s sustained, 70% reads / 30% writes, 5KB avg payload, 100 concurrent WebSocket connections with 1 msg/s heartbeat.

Validate that throughput targets are achievable by the target environment. Reject profiles without a read/write ratio or concurrency definition.

[SOAK_DURATION_HOURS]

Total duration the steady-state load must be maintained

48

Must be an integer >= 4. Durations under 4 hours are unlikely to surface slow-burn failures. Validate against environment lease or cost constraints.

[RESOURCE_MONITORING_TARGETS]

Specific metrics and components to trend over the soak duration

JVM heap usage for Order Service, PostgreSQL connection count, Kafka consumer lag, disk usage on /var/log partition, Redis memory fragmentation ratio.

Each target must specify a component and a metric. Reject entries that only name a service without a metric. Check for missing disk and file descriptor monitoring.

[MEMORY_LEAK_THRESHOLD_MB_PER_HOUR]

Acceptable memory growth rate before flagging a potential leak

5 MB/hour for Order Service, 2 MB/hour for User Service

Must be a positive number with units. Null allowed if memory leak detection is out of scope. Validate that thresholds are lower than total allocated heap.

[LOG_ROTATION_CHECKPOINT_INTERVAL_MINUTES]

Frequency for verifying log files are rotating and not accumulating indefinitely

60

Must be an integer >= 15. Check that the interval is shorter than the disk-fill risk window. Reject intervals longer than the soak duration.

[FAILURE_ABORT_CONDITIONS]

Conditions that trigger immediate test termination for safety

Order Service error rate > 5% for 5 minutes, PostgreSQL replication lag > 30 seconds, any persistent volume exceeds 85% capacity.

Each condition must include a metric, a threshold, and a duration or persistence qualifier. Reject conditions that are purely informational without an abort trigger.

[CONNECTION_POOL_SATURATION_INDICATORS]

Metrics that signal connection pool exhaustion or leak

Active connections exceeding 80% of pool max for > 10 minutes, connection wait time p99 > 100ms, abandoned connection count > 0.

Must reference specific pool configurations. Validate that pool max sizes are known and indicators are measurable from the target system.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the soak test scenario prompt into a reliability engineering workflow with validation, retries, and human review gates.

This prompt is designed to be called from a reliability engineering pipeline or a manual QA planning tool, not as a standalone chat interaction. The primary integration point is a function that accepts a system architecture description, known failure modes, and a target duration, then returns a structured soak test plan. Because the output directly influences production stability gates, the harness must validate the plan's completeness before it reaches a human reviewer or an automated test orchestrator.

Integration pattern: Wrap the prompt in a service function generate_soak_scenario(system_context, duration_hours, known_risks). The function should: (1) assemble the prompt with the provided inputs and a fixed [OUTPUT_SCHEMA] that defines the required JSON structure (steady-state load profile, memory leak detection thresholds, log rotation checkpoints, resource trend criteria); (2) call the model with a low temperature (0.1–0.2) and JSON mode enabled to enforce structural consistency; (3) validate the returned JSON against the schema, checking that every required field is present, thresholds are numeric, and checkpoints are time-ordered; (4) on validation failure, retry once with the validation errors appended to the prompt as [CONSTRAINTS] feedback; (5) log the final output, model version, and validation result for auditability. Model choice: Use a model with strong structured output support (GPT-4o, Claude 3.5 Sonnet, or equivalent) because the scenario requires precise numeric thresholds and temporal ordering that smaller models often fumble. Retry logic: Limit to one retry. If the second attempt also fails validation, escalate to a human reliability engineer with the partial output and validation errors flagged—do not silently fall back to a degraded plan.

Human review gate: Even after successful validation, the generated soak test scenario must be reviewed by a reliability engineer before execution. The harness should render the plan in a review UI that highlights: (a) the steady-state load profile with expected resource consumption; (b) each memory leak detection threshold alongside the component it monitors; (c) log rotation checkpoints on a timeline; (d) resource trend criteria with explicit saturation warnings. The reviewer can approve, modify, or reject the plan. Approved plans are serialized and passed to the test orchestrator (e.g., k6, Locust, or a custom soak test harness). Observability: Tag every generated plan with a unique plan_id, the prompt version, model version, and reviewer identity. Store the full prompt, raw model output, validation results, and reviewer decision in a queryable log for post-incident analysis. If a soak test reveals a failure mode the prompt missed, feed that gap back into the [KNOWN_RISKS] input for future generations.

What to avoid: Do not feed the raw model output directly into a test orchestrator without schema validation and human review. Do not use this prompt for short-duration load tests or spike tests—it is specifically tuned for multi-hour soak scenarios where slow-burn failures (connection pool leaks, disk accumulation, memory fragmentation) are the target. Do not skip the retry log; silent failures in soak test design can waste days of test execution time. If the system under test has no historical failure data, explicitly set [KNOWN_RISKS] to an empty list and add a note in the review UI that the plan is based solely on architectural analysis without empirical failure evidence.

IMPLEMENTATION TABLE

Expected Output Contract

Fields, types, and validation rules for the soak 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, max 200 chars. Must include duration and target system reference.

steady_state_load_profile

object

Must contain 'requests_per_second' (integer > 0), 'user_concurrency' (integer > 0), and 'request_mix' (array of objects with 'endpoint', 'method', 'weight_pct'). Sum of weight_pct must equal 100.

duration_hours

number

Must be >= 4 and <= 720. Represents total soak duration.

ramp_up_minutes

number

Must be >= 5 and <= 60. Must be less than 10% of total duration in minutes.

memory_leak_detection_thresholds

object

Must contain 'heap_growth_mb_per_hour' (number > 0), 'rss_growth_mb_per_hour' (number > 0), and 'sample_interval_minutes' (integer >= 1).

log_rotation_checkpoints

array

Array of objects with 'hour_mark' (integer, 0 to duration_hours) and 'expected_log_size_gb' (number). Must include checkpoint at hour 0 and final hour.

resource_trend_metrics

array

Array of strings from allowed set: ['cpu_utilization_pct', 'memory_usage_mb', 'disk_io_wait_ms', 'network_throughput_mbps', 'file_descriptors_count', 'connection_pool_utilization_pct', 'gc_pause_time_ms']. Minimum 4 metrics required.

failure_mode_hypotheses

array

Array of objects with 'failure_mode' (string), 'detection_signal' (string), and 'expected_time_to_manifest_hours' (number > 0). Minimum 1 hypothesis required. Each detection_signal must reference a metric in resource_trend_metrics.

PRACTICAL GUARDRAILS

Common Failure Modes

Soak tests reveal slow-burn failures that load tests miss. These are the most common failure modes when constructing soak test scenarios with LLMs and how to prevent them before execution.

01

Unrealistic Steady-State Load Profile

What to watch: The prompt produces a flat, unchanging load profile that doesn't reflect real production traffic patterns—missing diurnal cycles, batch job spikes, or weekday/weekend variation. A 24-hour flat load masks resource trends that only appear under natural ebb and flow. Guardrail: Require the prompt to ingest historical traffic shape data or specify a time-varying throughput curve with distinct phases (ramp, plateau, trough, secondary peak). Validate the generated profile against at least one week of production metrics before test execution.

02

Missing Slow-Burn Resource Thresholds

What to watch: The scenario defines duration but omits specific thresholds for memory growth rate, disk accumulation, connection count creep, or GC pause time degradation. Without numeric thresholds, the test runs but produces no actionable pass/fail signal for slow leaks. Guardrail: Require the prompt to output explicit threshold values per resource (e.g., heap growth < 5MB/hour, file descriptor count stable within 2% over 12 hours). Include a monitoring checklist that maps each threshold to a specific observability query or dashboard panel.

03

Log Rotation and Disk Exhaustion Blindness

What to watch: The scenario focuses on application metrics but ignores log volume growth, rotation policy gaps, and /var or data partition exhaustion. Soak tests that don't monitor disk utilization miss the most common long-running outage cause in production. Guardrail: Add explicit log rotation checkpoints to the scenario at intervals matching the rotation policy. Require the prompt to include disk usage trend projections and a pre-test assertion that log retention settings won't fill the volume within the soak duration.

04

Connection Pool Leak Detection Gap

What to watch: The scenario checks database connection counts but misses connection pool leaks in application-to-cache, message broker, or external API pools. Each pool type has different leak signatures—idle connections never released, wait time growth, or pool exhaustion under steady load. Guardrail: Require the prompt to enumerate every connection pool in the system architecture and produce per-pool monitoring criteria. Include a pre-test checklist that verifies pool metrics are exposed and baseline connection counts are recorded before the soak begins.

05

Garbage Collection and Memory Fragmentation Oversight

What to watch: The scenario tracks heap size but ignores GC pause time trends, promotion rates, and fragmentation metrics that degrade response times without triggering OOM alerts. Long-running processes can survive with stable heap but increasing GC pressure that manifests as latency drift. Guardrail: Require GC pause time percentile thresholds (p99 < 100ms sustained) and a trend analysis checkpoint every 4 hours. The prompt should produce a GC log analysis plan, not just a heap size watchpoint.

06

No Degradation Acceptance Criteria

What to watch: The scenario defines success as 'no crashes' but doesn't specify acceptable performance degradation over the soak duration. A system that slows by 40% over 48 hours without crashing is still failing. Without degradation criteria, the test passes while the system degrades. Guardrail: Require the prompt to output a degradation budget—e.g., p95 latency drift < 15% from hour-1 baseline, throughput variance < 5%, error rate increase < 0.1%. Include a comparison checkpoint at midpoint and endpoint against the initial baseline.

IMPLEMENTATION TABLE

Evaluation Rubric

Criteria for evaluating the quality of a generated soak test scenario before integrating it into a test harness or scheduling execution. Use these checks to catch brittle assumptions, missing failure modes, and unrealistic load profiles.

CriterionPass StandardFailure SignalTest Method

Steady-state load definition

Specifies exact requests per second, user concurrency, and payload mix for the target service

Vague terms like 'normal load' or 'typical traffic' without concrete numbers

Parse output for numeric throughput targets and a defined request mix ratio

Resource trend monitoring

Lists specific metrics (heap memory, disk usage, connection count) with collection intervals and trend thresholds

Only mentions 'CPU and memory' without specifying collection granularity or warning thresholds

Schema check for a monitoring block with metric names, interval in seconds, and threshold values

Slow-burn failure mode coverage

Includes at least one scenario for connection pool leaks, disk accumulation, or memory fragmentation

Focuses only on immediate crash scenarios like OOM kills or CPU saturation

Keyword search for 'leak', 'accumulation', 'fragmentation', or 'growth' in failure descriptions

Log rotation and checkpointing

Defines log rotation triggers, checkpoint intervals, and verification steps during the soak

Assumes infinite disk or ignores log growth entirely

Assert presence of a log management section with rotation size or time policy

Duration and ramp specification

Defines total soak duration, ramp-up period, steady-state window, and ramp-down procedure

Only states 'run for 24 hours' without ramp or cool-down phases

Parse for distinct duration fields: ramp_up, steady_state, ramp_down in minutes or hours

Safe-abort conditions

Lists explicit metric thresholds or error rates that trigger automatic test termination

No abort conditions defined, or abort relies on manual operator judgment

Check for an abort_criteria block with at least one numeric threshold and one error condition

Data volume growth projection

Estimates database size, log volume, or queue depth growth over the soak duration

Ignores storage impact of sustained load

Verify presence of a storage_forecast section with projected growth in MB/GB over the test window

Post-soak validation checks

Defines cleanup verification, resource reclamation expectations, and system health checks after load stops

Test ends at duration with no post-condition validation

Assert a post_test_validation block with at least one resource reclamation check

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a single steady-state load profile and simplified monitoring criteria. Replace detailed resource trend thresholds with directional checks (e.g., 'memory should not grow unbounded'). Drop log rotation checkpoints and focus on the core soak duration and pass/fail signal.

Prompt modification

  • Remove or comment out [LOG_ROTATION_CHECKPOINTS] and [DISK_ACCUMULATION_THRESHOLDS]
  • Simplify [RESOURCE_TREND_CRITERIA] to 'No sustained upward trend in memory, handles, or connections'
  • Set [SOAK_DURATION] to a shorter window (2-4 hours) for fast iteration

Watch for

  • Missing schema checks on the output format
  • Overly broad 'no degradation' criteria that can't be measured
  • No definition of what constitutes a pass vs. fail
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.