Skip to content

Flaky test: RedisTest::testIncrement fails on re-run (live-Redis state leakage) #84

Description

@ksandell

Summary

`tests/Cache/Adapters/RedisTest.php::testIncrement` (line 291) is not isolated: it asserts an incremented value of `1` but reuses a live Redis key without flushing it first. On a clean Redis it passes; on a second run (or any run where the key already exists) it fails with e.g. `Failed asserting that 9 matches expected 1`.

Reproduce

```
./vendor/bin/phpunit tests/Cache/Adapters/RedisTest.php
./vendor/bin/phpunit tests/Cache/Adapters/RedisTest.php # second run fails
```

Cause

The test increments a Redis key without deleting/resetting it in setUp/tearDown, so state leaks across runs against a shared Redis instance.

Fix

Delete the counter key (or flush the test DB) in `setUp()`/`tearDown()`, or use a unique key per run. Confirmed pre-existing — unrelated to the QUERY feature (PR #83); fails on a clean tree too.

Severity

Low — test isolation only; no production impact.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions