[Tests] Bound integration test cleanup when the cluster is recovering

Open
#178 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker-compose, php
Domain
databases, testing

Research direction

Start with tests/Integration/DatabaseCleanupTrait.php:33 and read RebootWorkerTest::waitForClusterAndWorkerToRecover() for the existing recovery pattern. Add a bounded health check before clearAll() and retry once if the first call fails, keeping healthy runs fast. Run make test, make test-integration, and bin/lint.sh; done means cleanup fails with a bounded, clear error during recovery and healthy integration runs retain their current runtime.

Written by the indexing model from the issue text.

Description

priority:low type:tests

Description

tests/Integration/DatabaseCleanupTrait.php:33 calls clearAll() in setUp()
without a bound or retry. If the cluster is unavailable because a compose worker
is still restarting, or a previous run left FDB unhealthy, the FFI call can block
for a long time before the suite reaches another test. #159 added a bounded wait
inside RebootWorkerTest, but this shared trait is used by every integration
test, so the next test can still hang before its own cleanup or assertion runs.

Impact: an integration run can appear to hang instead of failing fast, especially
after a killed container, a host under disk pressure, or a manual
docker compose stop/start. Found during the #159 review (PR #176).

Where to start

  • Add a bounded cluster-health wait before clearAll() (reuse the pattern from
    RebootWorkerTest::waitForClusterAndWorkerToRecover(), or a small shared
    helper), and retry once when the first call fails.
  • Alternatively, set a PHPUnit per-test timeout and let a hung test fail with a
    clear message rather than blocking the whole suite.
  • Keep the normal path fast: only wait when the cluster is not available or a
    status call fails.

Definition of done

  • A test that follows a stopped/restarting worker fails with a bounded,
    clear error instead of blocking clearAll().
  • A healthy integration run keeps its current runtime.
  • make test, make test-integration and bin/lint.sh are green.
Dominant language
PHP
Stars
0
Forks
0
Avg merge
10h 4m
Merged PRs (30d)
19

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from crazy-goat/fdb-php

All issues in crazy-goat/fdb-php

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.