Integration Tests¶
The integration/ directory in the repository contains a full Docker
Compose environment with all six sink types, multiple worker clusters,
realistic load patterns, and a chaos test scenario. It is intended for
development and testing only – not as a production deployment
reference. Credentials are hardcoded, services run without
authentication, and all data is ephemeral.
Quick Start¶
This starts 23 services, including six workers in three clusters. (A
twenty-fourth, load_generator_tenant_a, is gated behind the tenant Compose
profile, and the scenarios start the workers of the twin, headless and
stream profiles themselves.) First run pulls images and builds workers (~2 minutes).
Subsequent runs start in seconds.
To stop everything:
Profiles¶
just integration-up takes a profile that sets the size of the run:
| Profile | Messages | Use it for |
|---|---|---|
full (default) |
5000, repeat counts as given | The long soak. A run with a service-backed provider takes about two hours. |
quick |
1000, repeat counts scaled by 0.2 (REPEAT_SCALE=0.2) |
Development checks and the run matrix. Every producer phase stays, with less work in each. |
A value of TOTAL_MESSAGES or REPEAT_SCALE that is already in your
environment wins over the profile. The scenario scripts read the message
total from the running producer, so a profile cannot disagree with the
checks.
Services & Ports¶
Infrastructure¶
| Service | Port | Description |
|---|---|---|
| Kafka | 9092 | Single-node KRaft broker (no Zookeeper) |
| PostgreSQL | 5432 | drakkar database with search_results table |
| PostgreSQL (fleet) | 5434 | drakkar_fleet database: the main cluster’s worker registry and periodic election when the harness runs with the postgres provider |
| Redis (fleet) | 6380 | Database 3: the main cluster’s worker registry and periodic election when the harness runs with the redis provider. The default user is off; the only user is drakkar (password drakkar) |
| Consul (fleet) | 8500 | A single Consul agent in dev mode: the main cluster’s worker registry and periodic election when the harness runs with the consul provider. ACLs are on and deny by default; the one-shot consul-fleet-init creates the workers’ token |
| MongoDB | 27017 | Document archive |
| Redis | 6379 | Cached search summaries (1h TTL) |
| Webhook | 9000 | HTTP echo server for webhook sink |
| Prometheus | localhost:9099 | Scrapes all worker metrics |
Web UIs¶
| URL | Service |
|---|---|
| localhost:8088 | Kafka UI – topics, messages, consumer groups |
| localhost:8089 | MongoDB Express – collections, documents |
| localhost:8087 | Redis Commander – keys, TTLs |
Main Cluster (ripgrep search)¶
3 workers, consumer group drakkar-integration, 50-partition topic.
| Worker | Operator UI | Metrics | Webapp | Config |
|---|---|---|---|---|
| worker-1 | localhost:8081 | localhost:9090 | localhost:8091 | 4 executors, all 6 sinks, webapp enabled, recorder off (events in memory only) |
| worker-2 | localhost:8082 | localhost:9091 | – | 4 executors, all 6 sinks |
| worker-3 | localhost:8083 | localhost:9093 | – | 4 executors, all 6 sinks |
Webapp port follows the integration convention API port + 10
(worker-1 API 8081 → webapp 8091). The framework default outside
the integration cluster is 8090; the integration drakkar.yaml
overrides it to keep the port plan consistent across services.
Only worker-1 has DK_SOURCES__HTTP__ENABLED=true; worker-2 and worker-3
are Kafka-only. This is intentional – it demonstrates the
load-balancer caveat for the
synchronous HTTP endpoint: requests land where they’re sent, no
framework-level redistribution.
Fast Cluster (symbol counting)¶
2 workers, consumer group drakkar-fast, same source topic. Both keep
their recorder history in Postgres (DK_RECORDER__PROVIDER:
"postgres"): the table drakkar.fast_recorder_events on postgres-fleet,
with the table prefix fast and a retention of 2 hours. postgres-fleet
starts with every provider.
| Worker | Operator UI | Metrics | Config |
|---|---|---|---|
| fast-worker-1 | localhost:8084 | localhost:9094 | 2 executors, Kafka-only sink |
| fast-worker-2 | localhost:8085 | localhost:9095 | 2 executors, Kafka-only sink |
Stream Worker (profile stream)¶
One worker with a handler that implements
arrange_stream()
(integration/stream-worker/), in the cluster stream cluster with the
consumer group drakkar-stream. It reads its own topic, stream-requests,
and writes to stream-records; both have one partition. The one source
partition is what makes the scenario’s bound “the limit plus one group”
hold: the pending limits are passed by at most one group for each message
that streams, and with one partition one message streams at a time. A request names a
number of groups and of tasks per group; the handler yields the groups one
at a time and labels each task with its group’s name. on_group_complete()
writes notes['done'] and sends one group record, and
on_message_complete() sends one final record with the sum of the notes.
scenario-arrange-stream.sh starts and removes it; just integration-up
does not start it.
| Worker | API | Metrics | Config |
|---|---|---|---|
| stream-worker | localhost:8095 | localhost:9101 | 4 executors, executor.max_pending_tasks: 40, one Kafka sink, no UI, no recorder, DLQ off |
Split Workers (profile split)¶
Three workers with a handler that implements split()
(integration/split-worker/), in the cluster split cluster with the
consumer group drakkar-split. They read their own topic,
split-requests (6 partitions), and use the parts topic and the results
topic with their default names. A request carries a list of items; a
request with more than 20 items is split into parts of 5 items, a smaller
one runs on its owner as a local message. Each item is one task that
sleeps its sleep_ms and exits by its mode (ok, fail, or hang for
150 s). on_task_complete() writes one record per item to split-items
(a part sink), and aggregate() writes one summary per request to
split-summaries (the aggregate sink) with the part counts and the items
counted from job.results(). A failed item under fail_policy: dlq ends
its part with a dlq outcome. The workers run filesystem autodiscover in
a volume of their own and have the detach routes on, so an operator can
detach one. split.job_timeout comes from SPLIT_JOB_TIMEOUT (default
5m). scenario-split.sh starts and removes them; just integration-up
does not start them.
A few settings exist only to make the checks practical:
| Setting | Value | Why |
|---|---|---|
sources.kafka.session_timeout |
10s |
The partitions of a killed worker move within seconds (the default is 45 s). |
executor.max_retries |
0 |
A failed item ends its task at once, so the DLQ check does not wait for retries. |
sinks.defaults.delivery_timeout |
2m |
Longer than the 60 s broker pause: with the default 30 s a part sink’s delivery fails during the pause, the part ends with a dlq outcome, and the request goes to the DLQ. |
sources.kafka.detach.cooldown |
0 |
The owner can detach right after a start or an earlier detach. |
stop_grace_period (compose) |
45s |
Longer than the 30 s drain, so a worker that is stopped on purpose commits the parts it ran and they do not run again at the next start. |
| Worker | API | Metrics | Config |
|---|---|---|---|
| split-worker-1 | localhost:8110 | localhost:9111 | 4 executors, split.enabled, two Kafka sinks, DLQ on, no recorder |
| split-worker-2 | localhost:8111 | localhost:9112 | as split-worker-1 |
| split-worker-3 | localhost:8112 | localhost:9113 | as split-worker-1 |
HTTP Cluster (the same search, over HTTP)¶
One worker, no consumer group. http-worker runs with
sources.kafka.enabled: false, so it is the harness’s
HTTP-only worker.
| Worker | Operator UI | Metrics | HTTP source | Config |
|---|---|---|---|---|
| http-worker | localhost:8086 | localhost:9096 | localhost:8092 | 2 executors, one Kafka sink, no Kafka source, DLQ off |
Its Compose healthcheck polls /readyz rather than /healthz, which is
exactly the HTTP-only readiness rule: the worker turns ready once its socket
is bound and every sink is connected, because it has no partitions to wait
for. Its
dlq.topic is empty and its Kafka source is off, so it also exercises
the path with no DLQ topic — its startup summary line reads
sources=[http:8092] ... dlq=unconfigured.
What It Does¶
Message Producer¶
The producer container sends 10,000 messages to search-requests in
phases that exercise different load patterns:
| Phase | Messages | Rate | Purpose |
|---|---|---|---|
| 0. Slow drip | 10 | 0.2/sec | Worker startup, first messages |
| 1. Warm-up | 500 | 15/sec | Steady ramp |
| 2. Pause | – | 15s silence | Consumer idle behavior |
| 3. Burst | 200 | max speed | Burst handling, backpressure |
| 4. Steady | 2,000 | 20/sec | Normal throughput |
| 5. Pause | – | 10s silence | Second idle period |
| 6. Burst | 300 | max speed | Second burst |
| 7. Cool-down | remaining | 10/sec | Drain |
| 8. Flood | 5,000 | max speed | Massive consumer lag |
3% of messages are “slow outliers” with repeat: 150-250 (the ripgrep
binary runs the search that many times), creating tasks that take
minutes instead of seconds. This exercises timeout handling and
mixed-duration workloads.
The HTTP mirror. After producing a message, the producer POSTs the
same JSON body to http-worker with probability HTTP_MIRROR_RATIO
(default 0.01, so about 1%). It logs one line per mirrored request:
Requests are mirrored, not diverted: the message still goes to Kafka,
so the main and fast clusters see it as usual. An HTTP error or a timeout
(5 s) on the mirror never fails the producer run. HTTP_MIRROR_URL and
HTTP_MIRROR_TOKEN point it at http://http-worker:8092/process with the
mirror client’s bearer token.
Main Cluster Processing¶
Each search message flows through:
- arrange() – creates a ripgrep task with CLI args
- Executor runs
/usr/local/bin/run-rg(ripgrep wrapper). A matching line longer than 500 characters is cut, so one result stays well under the Kafka message limit. - on_task_complete() routes results based on match count: - Always: Kafka (full result), Postgres (metrics row), MongoDB (archive), Redis (cached summary) - match_count > 20: HTTP webhook notification - match_count > 50: JSONL file log
- 5% simulated executor failures with retry via on_error()
- Failed deliveries route to DLQ or retry based on sink type
Fast Cluster Processing¶
Same source topic, different consumer group. Each message:
arrange()– creates one symbol-count task per file path of the message (the producer sends one or two)- Executor runs
count-symbols.sh(character counter) on_task_complete()– sends count tosymbol-countsKafka topic
Fast tasks finish in milliseconds, demonstrating duration threshold filtering and high-throughput behavior.
HTTP Cluster Processing¶
http-worker reuses the main cluster’s ripgrep handler
(integration/worker/http_handler.py, selected by WORKER_HANDLER=http-search;
its config is integration/http-worker/drakkar.yaml). Its
arrange_http_request calls the same task-building code arrange uses, so
a mirrored request runs the identical search. The response carries a
SearchResponse (request id, per-task match counts, succeeded and failed
counts), and because sources.http.deliver_to_sinks is on, the result also
goes to the search-results-http Kafka topic.
Webapp Pipeline (worker-1 only)¶
Worker-1 also runs the synchronous HTTP webapp. The
endpoint accepts a RankRequest body and returns a framework-built
WebReport JSON containing the user’s RankResponse plus per-task and
sink stats. See integration/worker/handler.py for the
arrange_http_request / on_http_request_complete implementation and
the task_priority override that pushes HTTP-origin tasks ahead of
Kafka tasks at the executor gate.
Two clients are configured (in integration/worker/drakkar.yaml):
| Client | Token | RPM cap |
|---|---|---|
anonymous |
(empty) | 4 |
tenant-A |
integration-tenant-a-token-do-not-use-in-prod |
60 |
A load_generator container drives a request every 10 seconds using
the anonymous client (so you can watch the rate-limit kick in at the
4-rpm cap). A second load_generator_tenant_a service is gated behind
the tenant Compose profile and uses the higher-rpm tenant token.
Comparing the two paths¶
The mirror makes the two input paths comparable on the same request. Both topics are keyed by request id, so one id can be read from each:
- Find a mirrored id in the producer log:
docker-compose logs producer | grep mirrorprints lines likemirror: req-000123 -> 200. - Open the Kafka UI and read
search-results— the Kafka path’s output for that id, written by the main cluster. - Read
search-results-http— the HTTP path’s output for the same id, written byhttp-worker.
The search itself is the same, so the two results should agree on the match
counts. What differs is everything around it: the Kafka row carries a real
partition and offset, the HTTP row carries the synthetic partition = -1
and a per-worker sequence number.
What the traces anchor on
On http-worker, a request trace in the operator UI carries the
handler’s own annotations only where the synthetic offset lines up.
The handler mirrors the runner’s per-request sequence number as that
offset, so the two agree for requests the runner numbered — the trace
is anchored on a counter, not on a Kafka coordinate.
Nothing verifies the mirror
verify_delivery.py does not check the mirrored 1%. It rebuilds the
produced id set and checks the Kafka path’s sinks. The mirror is a
demonstration of the HTTP-only worker, not an assertion; a mirrored
request that silently failed would not fail the harness.
Testing the Webapp¶
Hands-on with curl¶
While the stack is running, send a request as tenant-A (the 60-rpm cap leaves plenty of headroom for manual testing; the anonymous client is typically saturated by the load_generator):
curl -sS -X POST http://localhost:8091/process \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer integration-tenant-a-token-do-not-use-in-prod' \
-d '{"request_id": "manual-1", "score": 42}' | jq .
You should see a 200 response with the framework-built WebReport
envelope (request_id, client, started_at, duration_ms,
status, result, tasks, task_summary, cache, sinks,
timeline).
To provoke a 429 deliberately on tenant-A: hit the endpoint at
1 req/sec for ~60 seconds. The 60-rpm window fills and the 61st request gets 429 with a
Retry-Afterheader and thehintfield documented in webapp.md.
Watching the load_generator¶
# Default profile -- anonymous traffic only
docker-compose logs -f load_generator
# With the tenant-A profile
docker-compose --profile tenant up -d load_generator_tenant_a
docker-compose logs -f load_generator_tenant_a
Each iteration logs the request body and the response status. You’ll see 200 responses up to the rpm cap, then 429s once the sliding window fills.
What to check in the UI¶
Open worker-1’s UI:
- Dashboard
/– a “WebApp” tile appears alongside the partition tiles, showing in-flight requests, per-client rpm caps, and 60s success/error counts. - Live
/live– HTTP-origin tasks render with a distinct purple highlight and the identifier<client>:<request_id[:8]>instead of the Kafkap<partition>:o<offset>form. - History
/history– the Origin filter (top right) lets you view kafka-only / http-only / all events. Webapp-specific event types (webapp_request_received,webapp_request_completed,webapp_request_timeout,webapp_request_rate_limited,webapp_request_auth_failed,webapp_request_dropped_after_timeout) are visible here. - Task detail
/task/{id}– clicking an HTTP-origin task shows Client / Request ID (instead of Partition / Offset), the truncated request body, and the final response.
What to check in metrics¶
The webapp metrics live at
localhost:9090/metrics alongside the
existing executor and sink counters. Filter for drakkar_webapp_:
| Metric | Type | Labels |
|---|---|---|
drakkar_webapp_requests_total |
Counter | {client, status} |
drakkar_webapp_request_duration_seconds |
Histogram | {client, status} |
drakkar_webapp_inflight |
Gauge | – |
drakkar_webapp_dropped_after_timeout_total |
Counter | {client} |
drakkar_webapp_rpm_limit |
Gauge | {client} (informational) |
A useful Prometheus query while the load_generator runs:
Demonstrating priority scheduling¶
The integration handler’s task_priority override returns a
priority key of (0, ...) for task.origin == 'http' tasks and
(1, source_offset) for Kafka tasks. Under sustained Kafka load, a
manual curl request lands in the executor gate ahead of the queued
Kafka tasks. The effect is visible in /live – HTTP tasks dequeue
near-instantly even when the Kafka partition queues are full.
To exercise this end-to-end:
- Start the stack and the producer (default).
- Wait until pool utilization on worker-1 is near 100% from Kafka traffic.
- Hit
/processwithcurl(or just leave theload_generatorrunning). - Watch
/liveon worker-1: HTTP-origin tasks (purple) are scheduled immediately; Kafka tasks remain queued behind them.
Toggling deliver_to_sinks¶
The webapp’s deliver_to_sinks mode is OFF by default in the integration
config. To exercise it:
# In integration/docker-compose.yml -> worker-1 -> environment
DK_SOURCES__HTTP__DELIVER_TO_SINKS: "true"
Restart worker-1. Now each HTTP request also flows through the
handler’s on_message_complete and writes to Kafka / Postgres /
MongoDB / Redis like a Kafka-source message. The framework adds a
sinks: { ... } summary to the response body documenting per-sink
attempted/delivered/dlq counts.
Operator UI Pages¶
Open any worker’s UI to explore:
Dashboard (/)¶
Partition tiles with queue depth and lag, executor pool utilization bar,
event counters, Prometheus graph links (click any metric card).
Custom links configured via custom_links in config.
Partitions and sinks tables (on /)¶
The Dashboard also holds the per-partition table (queue size, pending offsets, committed offset, consumer lag) and the per-sink table (delivered count, error count, retry count, last delivery time and duration).
Live Pipeline (/live)¶
Three tabs, all WebSocket-powered:
- Arrange – recent arrange() calls with message labels, task counts, durations
- Executors – scrollable timeline with task bars (green=completed, yellow=running, red=failed). Hover for task detail. Zoom in/out with ± buttons.
- Collect – recent on_task_complete() completions with output counts
The pool utilization bar and running/finished task tables update in
real time. Task labels (request_id, pattern) appear in the Labels
column and hover detail.
History (/history)¶
Filterable event browser. Toggle event types (consumed, arranged, task_started, task_completed, task_failed, etc.) and filter by partition. Paginated.
Debug (/debug)¶
Three collapsible sections:
- Metrics – all Prometheus metrics (framework + user), filterable by source
- Message Trace – enter
partition:offsetto trace a message through the full pipeline, including cross-worker search - Databases – SQLite flight recorder files, sortable/filterable, downloadable. Select multiple and merge into one file.
Task Detail (/task/{id})¶
Full task lifecycle: status, labels, partition, duration, PID, CLI command, source offsets (linked to trace), stdout/stderr output, event timeline.
Operator Docs Site (/docs/)¶
The handbook the worker serves for itself (see
Operator Docs Site) – hand-written HTML under
integration/worker/docs-site/, not an mkdocs build, to show that any
prebuilt static directory works. The nav entry opens it in a new tab;
ui.docs.anchors also puts a book icon on the module label chips of a
task detail page, on the archive_results_db row of the sinks table, and
on the scan_window_processing_range entry in the Live timeline’s event
list. Each icon opens that page in a drawer beside the live view.
Kafka Topics¶
| Topic | Partitions | Producers | Consumers |
|---|---|---|---|
search-requests |
50 | producer | main cluster, fast cluster |
search-results |
50 | main cluster | – |
search-requests_dlq |
50 | main cluster (DLQ) | – |
symbol-counts |
50 | fast cluster | – |
search-results-http |
50 | http cluster | – |
stream-requests |
1 | scenario-arrange-stream.sh |
stream worker |
stream-records |
1 | stream worker | – |
split-requests |
6 | scenario-split.sh |
Starts split-worker-1, -2 and -3 (profile split) and runs ten checks, each with its own request and its own CHECK <n> line; before each check the three workers are ready and the committed offset of drakkar-split is at the end of every partition of split-requests, and after it a killed, detached or stopped worker comes back. 1: a request of 60 items (12 parts). 2: a request of 10 items. 3: a worker that is not the owner is killed (docker kill) while it has a part of the request in progress. 4: the owner (the worker that logged split_job_opened for the request id) is killed after split_job_done. 5: the owner is killed during a split slowed by split_pause_ms. 6: one item fails under fail_policy: dlq. 7: the workers are recreated with SPLIT_JOB_TIMEOUT=90s and one item hangs past it (about three minutes), then recreated with the default. 8: the three workers are restarted one after another during a job. 9: the owner detaches through POST /api/v1/debug/detach during a job, and is attached again. 10: the broker is paused for 60 s during a job; the pause also stops the main cluster, so the check waits until its workers are ready again. The scenario removes the workers at the end. |
split-requests_drakkar-split_split_parts |
6 | split workers (owners) | split workers |
split-requests_drakkar-split_split_results |
6 (the count of split-requests) |
split workers | split workers (owners) |
split-items, split-summaries |
6 | split workers | – |
split-requests_dlq |
6 | split workers (DLQ) | – |
split-requests_status |
3 (cleanup.policy=delete, retention 24 h) |
split workers (status of HTTP jobs) | split workers (every worker follows it) |
Browse topics in the Kafka UI.
Worker Autodiscovery¶
All workers write to /shared (mounted as a volume). Each worker
publishes its card to the fleet registry and reads the cards
of the others, so the operator UI lists
every worker. Use the worker dropdown in the top-right nav to switch
between workers without remembering ports.
The fast workers and the HTTP worker always keep their cards in the
registry folder in /shared. The main cluster (worker-1..worker-3)
takes its registry and periodic-election provider from the argument of
just integration-up:
just integration-up # filesystem: cards in /shared
just integration-up provider=postgres # postgres: cards in the postgres-fleet database
just integration-up provider=redis # redis: cards in database 3 of redis-fleet
just integration-up provider=consul # consul: cards in the KV store of consul-fleet
The argument sets HARNESS_PROVIDER, which docker-compose.yml passes to
the three workers as DK_AUTODISCOVER__PROVIDER and
DK_AUTODISCOVER__PROVIDER. The periodic election decides which
worker runs each slot of a cluster task: the archive and the handler’s
harness_cluster_tick. With postgres, both use the
connection connections.postgres.main: its DSN in
drakkar.yaml has no password, and docker-compose.yml supplies the
full DSN through DK_CONNECTIONS__POSTGRES__MAIN__DSN. The worker
creates the drakkar schema and its tables in drakkar_fleet on first
use.
With redis, both use the connection connections.redis.main: its URL
in drakkar.yaml has no password, and docker-compose.yml supplies the
full URL through DK_CONNECTIONS__REDIS__MAIN__URL. The keys start with
drakkar: (the state_prefix) and are in database 3 (the path of the URL).
redis-fleet starts with the default user off and one user, drakkar,
that has exactly the rights that
Security gives the providers:
~drakkar:* +@read +@write +@scripting +@connection +time. A run with
redis therefore also shows that these rights are enough.
With consul, both use the connection connections.consul.main: its
entry in drakkar.yaml has the address and the state_prefix (drakkar)
and no token, and docker-compose.yml supplies the ACL token through
DK_CONNECTIONS__CONSUL__MAIN__TOKEN. consul-fleet runs with ACLs on and
the default policy deny. Before the workers start, consul-fleet-init
(the script integration/infra/init-consul.sh) creates the policy
drakkar-fleet and a token of that policy for the workers. The policy has
exactly the two rules that
Security gives the providers:
key_prefix "drakkar/" { policy = "write" } and
session_prefix "" { policy = "write" }. A run with consul therefore
also shows that these rights are enough. The management token of the
agent and the workers’ token are fixed UUIDs in docker-compose.yml. They
are harness values, not secrets. The agent keeps its state in memory: a
new consul-fleet container starts empty, and the next
just integration-up runs consul-fleet-init again, which finds or
creates the policy and the token.
The main cluster’s registry timings are short, so that the scenarios
below finish in minutes: a card is published every 2 s and read every
3 s, a worker whose card is 10 s old is offline, and a card 30 s old is
deleted. With consul a card is not listed offline: the session of the
card has a TTL of 10 s, and Consul deletes the card with the session about
20 s after the last publish. Each call to the provider has 2 s and one
retry, and three failed operations open the
circuit breaker for 10 s. The periodic election
uses the same resilience block (autodiscover.resilience).
Chaos Test¶
The chaos-test.sh script simulates cascading worker failures and
recoveries:
Scenario: Rolling Outage¶
| Time | Event | Live Workers |
|---|---|---|
| t1 | ~3000/10000 tasks processed | w1, w2, w3 |
| t1 + 30s | worker-2 stops | w1, w3 |
| t1 + 150s | worker-3 stops | w1 only |
| t1 + 390s | worker-2 starts, worker-1 stops | w2 only |
| t1 + 450s | worker-1 starts | w1, w2 |
| t1 + 510s | worker-3 starts | w1, w2, w3 |
Total runtime: ~10 minutes. The script polls each worker’s
/api/v1/dashboard every 5 seconds and prints per-worker completed
task counts and partition counts, so you can watch rebalancing happen.
What to observe:
- Partition reassignment in
/history(filter byassigned/revokedevents) - Pool utilization spike on surviving worker in
/live - Consumer lag changes in the partitions table on
/
The script does not stop at “watch it happen”. When the outage sequence finishes it runs the delivery verification below and exits non-zero if anything was lost, duplicated past the cap, or reordered – so a chaos run is a pass/fail gate, not an invitation to read three dashboards.
Provider outage scenarios¶
Seventeen scripts check how the main cluster’s registry and cluster tasks behave when their provider, the network or a worker fails, how the recorder memory store works with and without a recorder file, what the DLQ record of a message that cannot be parsed holds, whether the backpressure caps hold under load, whether a twin worker name is refused, whether the routes of the Databases view answer, and how a stream handler holds its pending tasks and runs a message again after a restart, and how split jobs survive kills, restarts, a detach and a broker pause, and how split jobs that arrive over HTTP report their status. Start the harness with a provider, wait until the workers are healthy, then run the scenarios with the same provider:
just integration-scenarios runs the seventeen scripts in the order below and
stops at the first failure. Each script prints one VERDICT line and
exits 0 on a pass (or when it does not apply to the provider) and 1 on a
failure. You can also run one script alone, for example
HARNESS_PROVIDER=redis integration/scenario-secrets.sh.
just integration-scenarios first runs integration/wait-ready.sh. It
returns when worker-1 lists worker-2 and worker-3 online, and it fails after
300 seconds and prints the last list it saw. The scenarios start only after
that.
A run with postgres, redis or consul and the full profile takes about two hours: the paced phases of
the producer take about 7 minutes, and the main cluster then needs an hour or more to
work off the backlog before just verify-delivery can check it. The outage
scenario allows up to two hours for that drain. With filesystem the outage
scenario does not apply, and the others take a few minutes each (the
cluster-tasks scenario watches its slots for about five minutes, the
backpressure scenario waits until the fast cluster has worked off the
producer’s messages, and the unclean-exit scenario waits up to 390 s after
the restart of worker-2 for its leftover).
| Script | What it does | What it proves |
|---|---|---|
scenario-service-outage.sh |
Pauses the service of the provider (postgres-fleet, redis-fleet or consul-fleet) for 90 s, twice: the second pause starts after the recovery from the first. A paused container keeps its connections open and answers nothing. When consul-fleet resumes, it ends at once every session whose TTL ran out during the pause, so the workers create new sessions. |
For each pause: within 40 s the registry breaker of worker-1 opens (drakkar_provider_breaker_open{feature="registry",provider="<provider>"} is 1), within 60 s of the unpause it is closed and worker-1 lists worker-2 and worker-3 online, and no worker restarts. The second pause shows that the first one left nothing behind that keeps the next calls from reaching their time limit. Once the producer has printed PRODUCER_DONE and the main cluster has worked off its backlog (consumer lag 0, an hour or more after the flood phase), just verify-delivery passes. With filesystem it does not apply: there is no service to pause. |
scenario-backpressure.sh |
fast-worker-1 runs with executor.max_pending_tasks: 4 and executor.max_pending_bytes: 16MiB (DK_EXECUTOR__* in docker-compose.yml); the fast handler makes one task per file path, one or two per message. It samples drakkar_pending_tasks and drakkar_pending_bytes on fast-worker-1 every 0.5 s until the producer printed PRODUCER_DONE and the consumer group drakkar-fast has a lag of 0, asks Prometheus for the highest drakkar_pending_tasks of the run (scraped every 10 s), then reads the keys of the symbol-counts topic. The load is mostly over when it runs, so Prometheus holds the evidence; it runs after the outage scenario, which needs the main cluster busy through both pauses. |
Every sample is at most the task cap plus one message’s fan-out (6), and the Prometheus peak is between the cap (4) and that bound; the pending bytes stay at most the byte cap plus 64 KiB. drakkar_window_admission_wait_seconds_total{limit="tasks"} is above 0, so admission waited at a full cap. Every produced request id is a key on symbol-counts: the fast cluster delivered every message under the caps. Runs with every provider. |
scenario-worker-cut-off.sh |
Disconnects worker-3 from the Compose network for 90 s. | With postgres or redis, worker-1 lists worker-3 offline within 30 s, because worker-3 cannot reach the provider’s service and its card gets old. (The check waits for the verdict: a card 30 s old is deleted, and worker-3 would then be missing from the list rather than offline.) With consul, worker-3 is missing from worker-1’s list, or listed offline, within 30 s (the check accepts both): it cannot renew its session, and Consul deletes the card when the session ends. After the reconnect, worker-3 finds that its session has ended and publishes with a new one. With filesystem worker-3 stays online, because its card goes through the shared folder and not the network. worker-3’s completed-task counter does not go down, worker-3 is online again within 20 s of the reconnect, and no worker restarts. |
scenario-unclean-exit.sh |
Kills worker-2, which cannot withdraw its card. With consul it starts worker-2 again at once. |
With filesystem, postgres or redis: within 20 s worker-1 lists worker-2 offline, and within 45 s of the kill the card is deleted. After a start, worker-2 is online within 20 s with a new instance. With consul: the card is still held by the session of the killed worker, which lives until its TTL runs out. The new worker-2 takes the card over: within 10 s of the start (one heartbeat, one refresh and 5 s) worker-1 lists it with a new instance, and the agent log shows that the new worker-2 destroyed the old session, which did not end by its TTL. When the host starts the worker too slowly for that, the scenario fails and names the measured times. Before the kill, worker-2’s own folder main_cluster/worker-2/ exists in the shared bind mount (its storage.dir) with .owner.lock and the live recorder file that /api/v1/debug/databases?parts=own,storage names. At the end, the restarted worker-2 has sealed that file of the killed process as a leftover: it is in history/main_cluster/ with a meta file that names worker-2, it is gone from the own folder, and worker-2 logged recorder_leftover_sealed for it. A leftover is sealed once it is idle for 300 s, so this waits up to 390 s after the last start of worker-2. The second half tests the archive election; see The election half. The delivery after the kills is checked by the drain and delivery check after every scenario. |
scenario-twin-name.sh |
Starts the service worker-3-twin (profile twin): the worker name worker-3 in the main cluster with the provider of the run, but a storage.dir of its own inside its container, as if a second worker-3 started on another host. Its recorder is off. The container is removed at the end. |
The registry’s same-name check refuses it: its container exits with a non-zero code within 60 s, and its log has fleet_worker_name_in_use for worker-3 with the running worker-3’s instance as other_instance, and the text worker name 'worker-3' is used by a live worker. worker-1 still lists worker-3 online with the same instance, worker-3 answers /readyz, and no main-cluster worker restarted. Runs with every provider. |
scenario-secrets.sh |
Reads the config reference and the metrics page of each main-cluster and fast-cluster worker, and their logs. | None of them contains the password of the Postgres DSN or of the Redis URL (drakkar:drakkar@, postgresql://drakkar:, redis://drakkar:) or the Consul token. The config reference of a main-cluster worker lists the three connections, with connections.consul.main.token masked; that of a fast worker lists connections.postgres.main.dsn, masked. Runs with every provider. |
scenario-cluster-tasks.sh |
Watches 8 slots of harness_cluster_tick, a cluster task of the harness handler with a slot every 30 s of epoch time, and 15 s after the last of them. Each run logs harness_cluster_tick with its slot. Then it reads /api/v1/workers on worker-2. |
No slot ran on two workers, and at least 7 of the 8 slots ran exactly once (a slot whose lease does not come within its 10 s acquire window is skipped, so one missed slot is allowed). worker-2 lists worker-1 with cluster_tasks_match: false (worker-1 turns the archive off, so its cluster task definitions differ), and worker-3 and itself with true. worker-3 matches only because worker-2 and worker-3 run the archive with the same settings and the same handler: a config change on one of them makes the check fail. Runs with every provider. |
scenario-recorder-memory.sh |
Reads /api/v1/debug/databases, /api/v1/events, the metrics and /api/v1/debug/download-live of worker-1, which keeps its recorder events in memory only (DK_RECORDER__ENABLED: "false", a memory window of 60 s), and of worker-2, which keeps the recorder file. When the shared history folder is still empty (a fresh harness, the script run alone), it first plants one small due window with integration/plant_history.py. |
worker-1 lists exactly one own database, the memory store, and no live file, and it lists the shared history folders. Its events answer has rows. Once it has run for 90 s, drakkar_recorder_memory_rows is above 0, drakkar_recorder_memory_evicted_rows_total{reason="window"} is above 0, drakkar_recorder_memory_oldest_age_seconds is at most 75 (the window, one flush interval and slack), and drakkar_recorder_memory_allocated_bytes is at least drakkar_recorder_memory_bytes. Its download-live without source answers a SQLite database (the memory store), and with source=file 404. worker-2 lists a memory row and a live row, and both source=file and source=memory download a SQLite database. The verdict line carries worker-1’s memory numbers and the count of ui_read_memory_timed_out lines in the logs of the three workers. Runs with every provider. |
scenario-recorder-postgres.sh |
Reads the table drakkar.fast_recorder_events with psql in postgres-fleet, and the history search, the metrics and /api/v1/debug/databases of fast-worker-1. It creates a partition of the hour 5 hours ago by hand and restarts fast-worker-1, then pauses postgres-fleet for 60 s and, later, for 15 s. |
The table exists, its comment is retention_hours=2, and the partitions of the current hour to 3 hours ahead exist. The rows of the cluster fast cluster grow over 30 s, with the names of both fast workers. /api/v1/debug/trace?history=1 for one consumed message answers a non-empty list: every row has worker_name, one row is consumed, and no row has a cluster key. Within 60 s of the restart the hand-made partition is gone and a fast worker logged recorder_postgres_partitions_changed with it: fast-worker-1 at its start, or fast-worker-2 when its own upkeep (every 300 s) came first; the verdict names the worker. During the 60 s pause drakkar_recorder_postgres_queue_rows rises above 0; within 60 s of the unpause it falls below 5000 (batch_rows) and drakkar_recorder_postgres_rows_written_total rises; drakkar_recorder_postgres_dropped_rows_total does not change. During the 15 s pause the history search answers 503 {"detail": "history search failed"} within 12 s (recorder.search.timeout and 2 s). fast-worker-1 lists exactly one own database, the memory store. Runs with every provider. |
scenario-dlq-record.sh |
Produces one message into search-requests with the console producer of the kafka service: a key and a value unique to the run (the value is not JSON, so the harness input model cannot parse it) and three headers, the last a stale dk-stage: replayed. The main cluster runs with DK_SOURCES__KAFKA__ON_PARSE_ERROR: "dlq". It then reads the DLQ topic through worker-1’s GET /api/v1/debug/kafka/dlq/messages (a time window from shortly before the produce) until a record with that key is there, for up to 600 s, and reads the source message at the record’s dk-source-partition and dk-source-offset through GET /api/v1/debug/kafka/source/message. |
The record’s key and value are the produced bytes. Its headers are exactly the two source headers that do not start with dk-, in their order, then dk-record-version (1), dk-stage (parse), dk-error (not empty), dk-source-topic (search-requests), dk-source-partition, dk-source-offset, dk-source-timestamp, dk-worker (a worker of the main cluster), dk-instance (16 hex characters) and dk-failed-at (RFC 3339 in UTC with microseconds): the order of the parse case of tests/fixtures/dlq_contract.json, with no dk-attempts, dk-sink or dk-task-id. The source message at the record’s offset is the produced one (same key, value and headers), and its timestamp is dk-source-timestamp. The verdict names both offsets and the worker that wrote the record. Runs with every provider. |
scenario-databases-view.sh |
Reads the routes of the Databases view: /api/v1/debug/databases?parts=own,storage,recorder and ?parts=bogus on worker-2, a slice of worker-2’s last 15 minutes (at most 1000 rows), /api/v1/debug/autodiscover on worker-1, /api/v1/debug/autodiscover/leases on worker-2, and /api/v1/debug/databases/postgres on fast-worker-1. |
worker-2 answers the worker, own, storage and recorder blocks and no history; its own folder is main_cluster/worker-2, its provider sqlite, it has a live row, and its siblings include worker-1 and worker-3. An unknown part answers 400 with the unknown-part message. The slice answers 200 as application/x-sqlite3 with X-Drakkar-Slice-Rows above 0, and the file opens as SQLite with that many events and the slice and slice_sources tables. The registry header names the provider of the run and lists worker-2 and worker-3; worker-2 has a lease row for history.archive; fast-worker-1 lists at least one partition of its recorder table. Runs with every provider. |
scenario-headless.sh |
Starts two workers of the profile headless in a cluster of their own: headless-recorder (no UI, the recorder on) and headless-no-api (no API, no UI, no recorder). It produces messages into the source topic, then stops and removes both. |
headless-recorder answers /healthz and 404 on a UI route; both workers deliver the messages (their sink counters rise); both exit with code 0, headless-recorder sealed a recorder file into the history folder, and headless-no-api left none. Runs with every provider. |
scenario-agent.sh |
Reads the agent routes on worker-1 (agent.enabled true, with a token), on worker-2 (the default, off) and on headless-recorder (no UI, the agent on), which it starts and removes. |
worker-2 answers 404 with the surface-off message; worker-1 answers 401 with no token and with a wrong one; with the token the index has schema 1, the worker name and the five agent routes; manual?topic=concept:pipeline answers the pipeline concept; state?parts=budget,partitions answers the budget numbers and a partition list; diagnose lists every framework rule in checked and none in failed; config?parts=connections and config?parts=agent show the DSN, the Consul token and the agent token masked and hold no password. headless-recorder answers /api/v1/agent with its token and 404 on /api/v1/identity. Runs with every provider. |
scenario-arrange-stream.sh |
Starts stream-worker (profile stream) and produces 3 requests of 30 groups of 10 tasks of 0.3 s into stream-requests. Until their 93 records are delivered and no task is pending, it samples drakkar_pending_tasks every 0.25 s (a peak shorter than that can be missed). Then it reads stream-records. It produces a fourth request, stops the worker once at least 8 of its group records arrived and before its final record, starts it again, and waits for that request’s final record. It removes the worker at the end. |
Every sample is at most the limit plus one group (50; the source topic has one partition, so one message streams at a time), and the peak reaches the limit (40); drakkar_window_admission_wait_seconds_total{limit="tasks"} is above 0. stream-records holds 90 group records (each group of each request once, 10 succeeded tasks, every task labelled with its group) and 3 final records (30 groups, done total 300), each final after the 30 group records of its request; drakkar_stream_group_tasks_count is 90 and its _sum 900. The stop logs arrange_stream_abandoned. The fourth request has records of two runs: the first run delivered group records and no final record, and the second run delivered each of the 30 groups once (every group of the first run again, so the message ran from its first group), then one final record. The first 3 requests did not run again. Runs with every provider. |
scenario-detach.sh |
worker-1, worker-2 and worker-3 run with sources.kafka.detach on, a 40 s lease, no cooldown and the operator routes on (DK_SOURCES__KAFKA__DETACH__* and DK_UI__DETACH_ENABLED in docker-compose.yml). The scenario detaches worker-2 through POST /api/v1/debug/detach (60 s), asks for a detach of worker-3 while worker-2 is away, attaches worker-2 through POST /api/v1/debug/attach, detaches it for 15 s and lets the deadline end it, then detaches it for 300 s and kills it, asks for a detach of worker-3 at once and again every few seconds, and starts worker-2 again. Last it writes the file detach-request-worker-3 into the shared folder: the periodic task detach_on_request of the harness handler (integration/worker/handler.py) takes the file and calls self.detach(duration=20), an example of a temporary detach from handler code. |
A detach moves every partition of worker-2 to worker-1 and worker-3 within executor.drain_timeout plus 15 s; worker-2 then holds none, /readyz answers 200, and worker-1 lists it with detached: true. A second detach while one worker is away answers budget_full, and that worker keeps its partitions. An attach gives worker-2 partitions again within 30 s. The deadline ends a detach without a new last_request and logs worker_attached with cause deadline. The slot of a killed detached worker stays held until its lease ends: a detach of worker-3 answers budget_full right after the kill and succeeds after the lease, while the started worker-2 is attached and holds partitions. The handler detach logs harness_detach_result with detached true, shows the origin handler, and ends by its deadline 20 s later. The scenario ends with the three workers attached, so it can run twice. Runs with every provider. |
scenario-split.sh |
Starts split-worker-1, -2 and -3 (profile split) and runs ten checks, each with its own request and its own CHECK <n> line; before each check the three workers are ready and the committed offset of drakkar-split is at the end of every partition of split-requests, and after it a killed, detached or stopped worker comes back. 1: a request of 60 items (12 parts). 2: a request of 10 items. 3: a worker that is not the owner is killed (docker kill) while it runs parts. 4: the owner (the worker that logged split_job_opened for the request id) is killed after split_job_done. 5: the owner is killed during a split slowed by split_pause_ms. 6: one item fails under fail_policy: dlq. 7: the workers are recreated with SPLIT_JOB_TIMEOUT=90s and one item hangs past it (about two minutes), then recreated with the default. 8: the three workers are restarted one after another during a job. 9: the owner detaches through POST /api/v1/debug/detach during a job, and is attached again. 10: the broker is paused for 60 s during a job. The scenario removes the workers at the end. |
1: at least two workers ran items of the request (the worker_id of its records on split-items), one summary with 12 parts, 12 received, 60 items, and the committed offset of the request’s partition stayed at or below the request while its parts ran and was never seen past it before the owner logged split_job_closed. 2: one summary of a local job with 1 part and 10 items, and no record on the parts topic. 3: one summary with every part received. 4: another worker logs split_job_resumed and closes the job; the parts topic has as many records of the request after the end as before the kill; one or two summaries, every part received. 5: another worker logs split_attempt_started; one summary of attempt 2 or later with 12 received parts. 6: one DLQ record with the request’s key and value byte for byte, dk-stage execute, dk-record-version 1 and a dk-error; no summary. 7: split_job_timed_out, one DLQ record with dk-stage aggregate and a dk-error that starts with job timed out after; no summary. 8 and 10: the job ends with summaries that each have every part received; in 10 no worker container exited or restarted. 9: another worker logs split_job_resumed and closes the job; one or two summaries. After each check the committed offset reaches the end of every partition. Runs with every provider. |
scenario-split-http.sh |
Starts split-worker-1, -2 and -3 (profile split), whose HTTP source serves /jobs (ports 8120 to 8122) with the clients tenant-a and tenant-b, and runs six checks, each with its own CHECK <n> line. 1: a request of 60 items by POST on split-worker-1. 2: a request of 10 items. 3: a second POST with the id of check 1, on split-worker-3. 4: a request of 60 items whose owner is killed (SIGKILL) during the job and started again. 5: a request with one item of mode fail under fail_policy: dlq. 6: a GET of an unknown id, a GET and a POST of the check-1 id by tenant-b. The scenario removes the workers at the end. |
1: 202 with accepted; a GET on split-worker-2 shows running with parts.received growing, then done within 5 minutes with result.items 60 and result.parts 12; no record with its key on split-items or split-summaries. 2: done with result.items 10, no parts in the status body, and no record on the parts topic. 3: 200 with the done status body; the source topic has exactly one record with that key, with the headers dk-origin, dk-request-id, dk-http-client and dk-deliver-sinks in this order and no other; no worker logged split_job_opened twice. 4: done with result.items 60. 5: failed with the outcome dlq; one record with its key on split-requests_dlq whose value equals the posted body byte for byte, and no header of it carries a client token. 6: 404, 404 and 409 request_id_in_use. Runs with every provider. |
The scenarios change the harness (a killed and restarted worker, a paused
service), so run just integration-down before the next run.
Drain and delivery check¶
integration/verify-after-drain.sh waits until the producer printed
PRODUCER_DONE and the consumer lag of the main cluster is 0. Then it runs
just verify-delivery with the message total of the producer. The outage
scenario calls it at its end. The run matrix calls it for every provider,
because the outage scenario does not apply to filesystem. The two waits
have limits of 2700 s and 7200 s; a small run sets shorter ones with the
environment variables PRODUCER_DONE_LIMIT_SECONDS and DRAIN_LIMIT_SECONDS.
The election half¶
The second half of scenario-unclean-exit.sh tests the election of the
archive task with the provider of the run. It uses these archive settings
of integration/worker/drakkar.yaml (recorder.archive):
| Key | Value | Effect |
|---|---|---|
window |
1h |
A window is one hour. |
due_after |
1h |
A window is due one hour after it ends. |
retention |
1d |
Archives are kept one day. |
interval |
30s |
An archive slot comes every 30 s of epoch time. At each slot one worker of the cluster wins the lease, looks for due windows and archives them. |
lease |
40s |
The lease of a holder that died ends 40 s after its last refresh; the next slot after that is won by another worker. |
Worker-1 is the observer of every scenario and sets
DK_RECORDER__ARCHIVE__ENABLED: "false" in docker-compose.yml, so it never
runs the archive and never holds its lock. It also keeps its recorder events in memory only
(DK_RECORDER__ENABLED: "false"), so it writes no recorder file
and seals nothing; worker-2 and worker-3 keep the file, seal it and archive
it. The lock is in
tasks/main_cluster/history.archive.lock in the shared folder
(filesystem), in the drakkar.task_locks table (postgres), under the key
drakkar:task-locks:main_cluster/history.archive (redis) or under the key
drakkar/task-locks/main_cluster/history.archive (consul).
The script plants a window with integration/plant_history.py: 50 sealed
recorder files of the main cluster, with real meta files, in one hour window
that ended 12 hours ago, so it is due at once. The size is set so that one
archive pass takes between 8 and 25 s, which is less than the 40 s lease.
The winner of a slot holds the lock for its whole pass and at least 20 s, also when nothing is due. A held lock alone therefore does not show the pass of the planted window, and the script times the plant against the slots:
- It waits until 2 s after a slot boundary S0. The winner of S0 has listed the history folder by then.
- It plants the window. When the plant ends later than 2 s before the next boundary S1, the script fails and names the plant’s duration: the winner of S1 may have listed a partial window.
- At S1 + 1 s it fails when the archive is already published (the winner of S0 acquired late and listed the plant). Otherwise the worker that holds the lock in two polls in a row is the winner of S1, which archives the planted window. It must be worker-2 or worker-3.
- It kills that worker at once and checks that the archive is not published yet and every planted file is still there. If the kill comes after the archive is published, the script fails and names the planted size.
- Within 150 s of the kill another worker must hold the lock, publish the
archive and delete every planted file. The dead holder’s lease ends up to
40 s after the kill, the next slot comes within 30 s, and the pass takes up
to about 40 s under load. With
filesystemandpostgresthe new holder logsperiodic_lock_taken_overwith its provider and the archive’s scope. - No slot of
harness_cluster_tickran twice from the plant to the end of the half.
On a Linux host the containers create the history and task folders as root
with mode 0700, so planting from the host needs write access there (a
sudo chown of integration/shared/history is enough; the script does not
write into integration/shared/tasks). macOS Docker hosts are not affected.
Run matrix¶
For filesystem, postgres, redis and consul, in this order, the recipe
clears integration/shared/ (except README.md; it is a bind mount that
integration-down does not clear) from inside a container, so the Docker VM
of a macOS host sees the delete at once, starts the harness with
integration-up, waits with wait-ready.sh, runs the seventeen scenarios and
verify-after-drain.sh, and runs integration-down, also after a failure. It
goes on after a failing step, prints a table with PASS, FAIL or N/A for each
provider and step, and exits non-zero when any step failed. N/A means the
scenario does not apply to the provider.
Verifying delivery¶
verify_delivery.py is what makes the harness a test rather than a demo. It
rebuilds the exact set of request ids the producer sent – they are numbered
req-000001..req-<TOTAL_MESSAGES>, not random – and checks it against
what the sinks hold.
The HTTP mirror does not affect it. Mirrored requests are sent to Kafka as well, so the produced id set is unchanged, and the mirror writes to its own topic rather than to the sinks these checks read. Nothing here verifies the mirrored 1%:
| Check | What a failure means |
|---|---|
no_loss |
A produced request has no request_summaries row. An offset was committed past a message whose sinks never confirmed. |
no_phantom |
A summary row exists for an id nobody sent. A corrupted key path, or a database still holding rows from an earlier run. |
update_not_reordered |
A request above the notify threshold still reads notified = false. The handler appends UPDATE notified immediately after the UPSERT that creates the row, and the upsert never writes that column – so an UPDATE that ran first matched nothing and lost the write. This is the on-disk signature of the Postgres sink executing payloads out of order. |
task_rows_present |
A rollup reports successful tasks but wrote no search_results rows. The per-request summary was delivered while the per-task writes behind it were not. A task that several requests share (the same pattern and file in one window) writes one row for each of them. |
duplication_bounded |
search_results rows per request passed the cap. At-least-once permits duplicates – the flood phase redelivers every request on purpose – but this many means messages are being replayed in a loop. |
Run it once the producer has finished and the pipeline has drained:
just verify-delivery 5000 # the TOTAL_MESSAGES the producer ran with
just verify-delivery 300 --dsn=... # other flags pass straight through
It waits until every produced request has its request_summaries row before
checking, because a request still in flight is indistinguishable from a lost
one. It gives up after --wait-seconds (default 300) and then reports the
requests that are still missing. A row count that stands still does not end
the wait: the last messages of a backlog arrive tens of seconds apart. Pass
--wait-seconds=0 to check immediately.
The reliable order is verify-after-drain.sh: it
waits for a consumer lag of 0 and then runs the check.
The scheduled Integration workflow runs verify-after-drain.sh against a
small 300-message corpus. The checks compare against the exact produced id
set rather than a sample, so a small corpus is as conclusive as a large one –
it just finishes inside the job’s budget.
Tuning for Experiments¶
Adjust message volume¶
TOTAL_MESSAGES is read from the environment, so export it before starting
the harness rather than editing the file:
Pass the same number to verify-delivery: request ids run req-000001
through req-<TOTAL_MESSAGES>, and that is how the verification knows what
to expect.
Change executor concurrency¶
Override per-worker via environment:
Test with fewer partitions¶
Edit integration/infra/init-kafka.sh:
Simulate slow tasks¶
Increase the slow-outlier percentage in integration/infra/producer.py:
Change rebalance speed¶
The main cluster uses sources.kafka.session_timeout: 10s for fast
rebalance detection. Increase for production-like behavior:
Disable duration thresholds¶
To see ALL tasks in the UI (including fast ones):
# integration/worker/drakkar.yaml or fast-worker/drakkar.yaml
logging:
min_task_duration: 0
ui:
ws_min_duration: 0
recorder:
capture:
min_event_duration: 0
min_output_duration: 0
Add auth to the UI¶
Protect database downloads with a token:
Then access protected endpoints with ?token=my-secret-token or
Authorization: Bearer my-secret-token header.