pendula checked before and after every release
The platform
Pendula was an Australian customer-engagement company. Its platform let a non-engineer build two-way messaging flows and run them against their own customers: a trigger fires, a flow runs, an action calls back, a message goes out. The messages went out under the customer's name, so a flow that stopped running meant their customers not hearing from them.
I worked on the platform's front end, building features and fixing interface bugs alongside two senior engineers. I also owned how it was tested before each release and watched in production: two test suites and the pipelines that ran them. This page is about that testing.
The problem
Most of the platform is asynchronous. A request that starts a flow is answered with an acknowledgement and the work happens afterwards, so asserting on that acknowledgement proves only that the platform accepted the request. Before a release, a regression suite checked the release candidate. After it, infrastructure monitoring reported whether the services were up, and a flow can stop running while every service it depends on is up.
Testing decisions
A round trip, not a response. The obvious check asserts on the response to the request that starts a flow, and it passes whenever the platform is accepting work, including while every flow behind it has stopped. I proposed a second suite that checks the round trip instead, and built it: synthetic traffic through real flows, all day, each message followed by its id until the platform's own callback brings it back. It costs a server to receive callbacks and a database to match them in. It is the version that fails when the platform goes quiet.
A grace period, not an immediate failure. Callbacks arrive late by design, so each canary type carries a window before a missing callback counts against it. Without one the suite reports failures that resolve themselves a few seconds later, and a monitor that cries wolf gets muted. The trade is that for the length of that window a late flow and a stopped flow look the same, a delay in detection I accepted deliberately.
| Check | at the request | inside the grace period | when it ends |
|---|---|---|---|
| Acknowledgementthe request is accepted | pass | no further check | no further check |
| Round tripthe callback comes back with its id | waiting | waiting | fail |
An in-memory database, not a database server. Records live for a day and every question asked of them is an aggregate over a short window: how many callbacks matched, at what response times, per canary type. That is an analytical query over a small table, which DuckDB answers inside the process with nothing to deploy, secure or pay for. A restart loses the window, which is affordable because the same numbers have already left as metrics, and an export endpoint returns the raw rows when someone wants them.
Load results on the platform's own dashboards. K6 writes its own summary at the end of a run, which is a report somebody has to remember to open. I compiled a custom K6 binary with the xk6 StatsD extension so the load figures arrived on the same dashboards as the platform's own metrics, next to what they are meant to be compared against.
One canary outside the load runner. The trigger canary has to hold a subscription open to receive what it fired, and a K6 iteration is a short-lived virtual user with nowhere to hold one. Rather than wrap the client to fit the runner, or weaken that canary into a fire-and-forget check, it runs as a plain Node process against the same server and writes the same rows. The cost is a second execution path to maintain.
Engineering
The canary suite. Each iteration generates one correlation id and threads it through three hops: a baseline request logged at once, a primary request that starts a real workflow, and the platform's callback when that workflow finishes. Two of those reach the canary server and are recorded, and matching them by id confirms the message made the round trip. Five canaries ran, four against a development environment and one against production, each isolated so a failure in one does not stop the others.
K6 mints one correlation id for this iteration.
| request | id | matched |
|---|---|---|
| baseline | · | · |
| callback | · | · |
// K6: one correlation id, threaded through both requests
const correlationId = uuidv4()
const t = Date.now()
http.post(REQUEST_BIN_URL, JSON.stringify({ correlationId, t, canaryType }))
http.post(WEBHOOK_URL, JSON.stringify({
outboundUrl: `${CALLBACK_URL}?correlationId=${correlationId}&t=${t}`,
}))
// Express: the same id comes back, matched and recorded
app.post('/webhook/callback', (req, res) => {
const { correlationId, t, canaryType } = req.query
const responseTime = Date.now() - Number(t)
db.run(insertLog, [correlationId, canaryType, 'callback', responseTime])
res.sendStatus(200)
})The Express server was built to run in production. Its /ping check answers 503 until the database is initialised, so the load balancer holds traffic off an instance that would drop callbacks. It drains in-flight requests on SIGTERM, with a forced exit twenty seconds later, and its keep-alive and header timeouts sit above the load balancer's idle timeout, so the balancer closes idle connections rather than the server racing it. Metrics leave through OpenTelemetry, to the collector in production and the console locally.
The regression suite. Cucumber.js and TypeScript, each scenario a real user path. Most steps cannot assert at once: a step authenticates, drives the GraphQL API, subscribes to the event stream with RxJS, then polls once a second until the workflow has run. The limits are per step. A synchronous read gets five seconds, because if it has not answered by then it is broken; an asynchronous path gets five minutes, so a slow run is not reported as a failure. Two dedicated tenants, one outbound and one inbound, keep a run away from real customer data.
// the platform answers late, so poll instead of asserting
async function pollUntil(cond, intervalMs, maxWaitMs) {
const start = Date.now()
while (Date.now() - start < maxWaitMs) {
if (await cond()) return true
await sleep(intervalMs)
}
return false
}Runtime types are checked at the boundary with io-ts decoders, and the suite runs as a multi-stage Docker build through a Go-Task Taskfile. Scenarios carry one of nine tags, so a run can take one category or all of them:
- trigger / actionRxJS observables, real-time handler
- flow lifecycleGraphQL, poll until complete
- inbound SMSinbound message routed to a flow
- email attachmentfile upload and processing
- data streamingAWS Kinesis
- token lifecycleAuth0 JWT, issue and refresh
- health checkavailability and response time
- pre-deploy smokerelease candidate, before it ships
- post-deploy checkthe same paths again, after it ships
Three pipelines. The first is how anyone ran the regression suite: a manual dispatch with a menu of the nine categories and a combined smoke run, so an engineer checking a release picks a category instead of cloning the repository and assembling a dozen environment variables. Cloud credentials are assumed through a role only for the streaming category that needs them. The smoke run is a matrix with fail-fast off, because the useful output of a pre-release check is every category that failed, not the first one.
- trigger / actionpass
- flow lifecyclepass
- inbound SMSfail
- email attachmentpass
- data streamingpass
- token lifecyclefail
- health checkpass
- pre-deploy smokepass
- post-deploy checkpass
Two failures reported, every category run.
The second builds only what changed. It reads the repository's project directories at runtime and generates its path filters from them, rather than keeping a hand-written list that goes stale the first time someone adds a project, and a sticky comment on the pull request carries the image references and digest, so ten pushes leave one comment rather than ten. The third runs on merge: the same build, then a repository_dispatch event, authenticated as a GitHub App, tells a separate deploy repository to roll the images out. The registry token the build needs is mounted as a BuildKit secret, so it is not left in a layer of the published image.
Where it stands
- test categories
- 9
- canaries
- 5
- pipelines
- 3
When I left in October 2025 the regression suite covered nine categories and ran from a dispatch menu, so anyone on the team could smoke test a release without a local setup, and five canaries ran continuously with their results on the same dashboards as the platform's own metrics. Pendula was acquired by Smart Communications that year.
Two limits. Four of the five canaries ran against a development environment, so most of the continuous signal was pre-production: it caught a broken deployment, not a customer-facing incident, and more production coverage was the next piece of work. And the five-minute limits that keep slow runs from reading as failures also mean a real failure takes five minutes to say so, which puts the suite in CI rather than in anyone's edit loop.
The source is private. The nearest public thing is drift-tests, the same BDD approach on a project of my own.