{"record":{"id":"d73ae09b7e003bf0","repo":"testcontainers/testcontainers-java","slug":"flaky-reviewdate-could-not-be-parsed-please-provide-a-date","errorCode":null,"errorMessage":"@Flaky reviewDate could not be parsed. Please provide a date in yyyy-mm-dd format","messagePattern":"@Flaky reviewDate could not be parsed\\. Please provide a date in yyyy-mm-dd format","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"test-support/src/main/java/org/testcontainers/testsupport/FlakyTestJUnit4RetryRule.java","lineNumber":55,"sourceCode":"            // leave the statement as-is\n            return base;\n        }\n\n        if (annotation.githubIssueUrl().trim().length() == 0) {\n            throw new IllegalArgumentException(\"A GitHub issue URL must be set for usages of the @Flaky annotation\");\n        }\n\n        final int maxTries = annotation.maxTries();\n\n        if (maxTries < 1) {\n            throw new IllegalArgumentException(\"@Flaky annotation maxTries must be at least one\");\n        }\n\n        final LocalDate reviewDate;\n        try {\n            reviewDate = LocalDate.parse(annotation.reviewDate());\n        } catch (DateTimeParseException e) {\n            throw new IllegalArgumentException(\n                \"@Flaky reviewDate could not be parsed. Please provide a date in yyyy-mm-dd format\"\n            );\n        }\n\n        // the annotation should only have an effect before the review date, to encourage review and resolution\n        if (LocalDate.now().isBefore(reviewDate)) {\n            return new RetryingStatement(base, description, maxTries);\n        } else {\n            return base;\n        }\n    }\n\n    private static class RetryingStatement extends Statement {\n\n        private final Statement base;\n\n        private final Description description;\n","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/testcontainers/testcontainers-java/blob/8e549514e3f01c57d70546fbb8599d138f3903e5/test-support/src/main/java/org/testcontainers/testsupport/FlakyTestJUnit4RetryRule.java#L37-L73","documentation":"FlakyTestJUnit4RetryRule parses reviewDate as an ISO local date (yyyy-mm-dd). If LocalDate.parse fails with DateTimeParseException, it throws IllegalArgumentException asking for the yyyy-mm-dd format. The review date enforces periodic re-evaluation of flaky tests.","triggerScenarios":"@Flaky(reviewDate = ...) given a non-ISO format such as '01/02/2026', '2026-1-5', or an invalid date like '2026-02-30'.","commonSituations":"US-style date entry (mm/dd/yyyy); missing zero padding; typos in month/day; localization-driven formats.","solutions":["Use strict ISO format yyyy-mm-dd, e.g. 2026-12-31","Zero-pad month and day (2026-03-05, not 2026-3-5)","Remove reviewDate if the annotation allows omitting it"],"exampleFix":"// before\n@Flaky(githubIssueUrl = \"...\", reviewDate = \"12/31/2026\")\n// after\n@Flaky(githubIssueUrl = \"...\", reviewDate = \"2026-12-31\")","handlingStrategy":"validation","validationCode":"LocalDate.parse(flaky.reviewDate()); // throws DateTimeParseException early in a unit test of your annotations","typeGuard":null,"tryCatchPattern":"try { LocalDate d = LocalDate.parse(reviewDate); } catch (DateTimeParseException e) { /* fix to yyyy-mm-dd */ }","preventionTips":["Always write dates in ISO yyyy-mm-dd","Zero-pad month/day","Add a unit test that parses all @Flaky reviewDates in the codebase"],"tags":["test-support","junit","date-format"],"backgroundTag":"invalid-date-format","analyzedSha":"8e549514e3f01c57d70546fbb8599d138f3903e5","analyzedAt":"2026-09-12T14:56:41.227Z","contentChangedAt":"2026-09-12T14:56:41.227Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}