backend-test-utils: deduplicate test infrastructure readiness-polling helpers

Extract shared internal helpers to eliminate near-identical readiness
polling loops across database and cache test infrastructure:

- waitForReady: generic probe-until-ready loop used by both postgres
  and mysql database helpers
- attemptKeyvConnection: generic Keyv set/get probe loop used by redis,
  valkey, and memcached cache helpers
- startRedisLikeContainer: shared container-start for redis-protocol
  stores (redis and valkey)

Also normalizes cache timeout error formatting to use stringifyError
instead of template string coercion.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
This commit is contained in:
Patrik Oldsberg
2026-04-13 19:47:25 +02:00
parent 925a63e27e
commit f44c6bd265
8 changed files with 183 additions and 195 deletions
@@ -0,0 +1,5 @@
---
'@backstage/backend-test-utils': patch
---
Deduplicated internal readiness-polling helpers used by the database and cache test infrastructure.