Skip to content

Enable late static binding in FunctionalTestCase for worker-specific test isolation #708

@dkd-kaehm

Description

@dkd-kaehm

Problem

FunctionalTestCase uses self::getInstanceIdentifier() and self::getInstancePath() which prevents subclasses from overriding these methods to provide worker-specific test instances.

This is required for proper test isolation in parallel test execution (e.g., with Paratest) where each worker needs its own isolated test instance directory and configuration.

Current Behavior

  • self:: binding means the parent class methods are always called
  • Subclasses cannot override getInstanceIdentifier() or getInstancePath()
  • All Paratest workers share the same test instance directory
  • Cross-contamination between parallel tests occurs

Expected Behavior

  • static:: binding enables late static binding
  • Subclasses can override these methods to provide worker-specific behavior
  • Each Paratest worker gets isolated test instance (e.g., functional-hash_w0, functional-hash_w1, etc.)
  • Tests run in parallel without interference

Solution

Replace self:: with static:: for getInstanceIdentifier() and getInstancePath() calls in FunctionalTestCase::setUp()

This is a simple change that enables proper test isolation for parallel execution while maintaining backward compatibility.

Use Case

Apache Solr for TYPO3 integration tests run with 8 Paratest workers:

  • Before: All workers share test instance → cross-contamination
  • After: Each worker gets isolated instance → clean parallel execution

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