{"record":{"id":"6ce67cf419bf7358","repo":"pestphp/pest","slug":"1","errorCode":"1","errorMessage":"The generated filter for this shard is too long (%d characters). This can cause issues with some environments (limit is %d characters). Please increase the number of shards (e.g., use 1/4 instead of 1/2) to reduce the filter length.","messagePattern":"The generated filter for this shard is too long \\((.+?) characters\\)\\. This can cause issues with some environments \\(limit is (.+?) characters\\)\\. Please increase the number of shards \\(e\\.g\\., use 1/4 instead of 1/2\\) to reduce the filter length\\.","errorType":"exception","errorClass":"InvalidOption","httpStatus":null,"severity":"error","filePath":"src/Plugins/Shard.php","lineNumber":263,"sourceCode":"                    $parts[] = preg_quote($key, '/').'\\\\\\\\'.(count($sub) > 1 ? '('.$subRegex.')' : $subRegex);\n                }\n            }\n\n            return implode('|', $parts);\n        };\n\n        return $buildRegex($tree);\n    }\n\n    /**\n     * @throws InvalidOption\n     */\n    private function ensureFilterLengthIsSafe(string $filter): void\n    {\n        $maxLength = (int) (getenv('PEST_SHARD_MAX_FILTER_LENGTH') ?: self::MAX_FILTER_LENGTH);\n\n        if (strlen($filter) > $maxLength) {\n            throw new InvalidOption(sprintf(\n                'The generated filter for this shard is too long (%d characters). '.\n                'This can cause issues with some environments (limit is %d characters). '.\n                'Please increase the number of shards (e.g., use 1/4 instead of 1/2) to reduce the filter length.',\n                strlen($filter),\n                $maxLength\n            ));\n        }\n    }\n\n    public function addOutput(int $exitCode): int\n    {\n        self::$passed = $exitCode === 0;\n\n        if (self::$updateShards && self::$passed && ! Parallel::isWorker()) {\n            self::$collectedTimings = $this->collectTimings();\n\n            $count = self::$knownTests !== null\n                ? count(array_intersect_key(self::$collectedTimings, array_flip(self::$knownTests)))","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/pestphp/pest/blob/1af74a215c3a89bc7a44fc6f9322e369eaad2423/src/Plugins/Shard.php#L245-L281","documentation":"Error \"The generated filter for this shard is too long (%d characters). This can cause issues with some environments (limit is %d characters). Please increase the number of shards (e.g., use 1/4 instead of 1/2) to reduce the filter length.\" thrown in pestphp/pest.","triggerScenarios":"Thrown at src/Plugins/Shard.php:263 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1af74a215c3a89bc7a44fc6f9322e369eaad2423","analyzedAt":"2026-08-21T02:16:38.132Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}