{"record":{"id":"5bf51b47c8d7ed64","repo":"openzipkin/zipkin","slug":"could-not-connect-to-storage-skipping-test","errorCode":null,"errorMessage":"Could not connect to storage, skipping test: {}","messagePattern":"Could not connect to storage, skipping test: (.+?)","errorType":"exception","errorClass":"TestAbortedException","httpStatus":null,"severity":"info","filePath":"zipkin-tests/src/main/java/zipkin2/storage/ITStorage.java","lineNumber":55,"sourceCode":"    if (!initializeStoragePerTest()) return;\n    doInitializeStorage(testInfo);\n  }\n\n  void doInitializeStorage(TestInfo testInfo) {\n    StorageComponent.Builder builder = newStorageBuilder(testInfo);\n    configureStorageForTest(builder);\n    // TODO(anuraaga): It wouldn't be difficult to allow storage builders to be parameterized by\n    // their storage type.\n    @SuppressWarnings(\"unchecked\")\n    T storage = (T) builder.build();\n    this.storage = storage;\n    checkStorage();\n  }\n\n  protected void checkStorage() {\n    CheckResult check = storage.check();\n    if (!check.ok()) {\n      throw new TestAbortedException(\"Could not connect to storage, skipping test: \"\n        + check.error().getMessage(), check.error());\n    }\n  }\n\n  @AfterAll void closeStorage() throws Exception {\n    if (initializeStoragePerTest()) return;\n    storage.close();\n  }\n\n  @AfterEach void closeStorageForTest() throws Exception {\n    if (!initializeStoragePerTest()) return;\n    storage.close();\n  }\n\n  @AfterEach void clearStorage() throws Exception {\n    clear();\n  }\n","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/openzipkin/zipkin/blob/878ce2a1fad54ca941d17fdcf2e1d924b148eb1f/zipkin-tests/src/main/java/zipkin2/storage/ITStorage.java#L37-L73","documentation":"ITStorage.checkStorage throws TestAbortedException ('Could not connect to storage, skipping test') when storage.check() reports a failure. This is Zipkin's integration-test harness: when the backing store (MySQL, Cassandra, Elasticsearch, ...) is unreachable, tests are skipped as aborted rather than failed, so CI without the storage dependency still passes.","triggerScenarios":"Running an IT- prefixed integration test (e.g. ITMySQLStorage) while the storage container/database is not running, credentials are wrong, or the storage is not yet ready (race at container startup).","commonSituations":"Docker daemon not running so the test container never starts; the database takes longer to accept connections than the test's startup wait; wrong host/port env vars; a new storage version that changes the health-check handshake.","solutions":["Start the storage backend first (docker-compose up, Testcontainers, or a local MySQL/Cassandra/ES) and confirm you can connect with the same credentials.","Set the connection env vars the module expects (e.g. MYSQL_HOST, CASSANDRA_CONTACT_POINTS, STORAGE_TYPE) before running the tests.","If startup is slow, increase the readiness wait so checkStorage runs only after the port actually accepts connections."],"exampleFix":"# before: storage not running, tests abort\nmvn test -pl zipkin-storage/zipkin-mysql\n\n# after: start storage, then run tests\ndocker run -d -p 3306:3306 -e MYSQL_USER=zipkin -e MYSQL_PASSWORD=zipkin mysql:8\nmvn test -pl zipkin-storage/zipkin-mysql","handlingStrategy":"fallback","validationCode":"// before running ITs, verify the storage endpoint is reachable\ntry (Socket s = new Socket()) { s.connect(new InetSocketAddress(host, port), 2000); }","typeGuard":null,"tryCatchPattern":"catch (TestAbortedException e) { /* storage unavailable: log and mark build as unstable rather than failed */ }","preventionTips":["Start storage containers (docker-compose/Testcontainers) before the test phase in CI","Fail CI on silent skips by counting aborted tests","Set the module's connection env vars explicitly in the pipeline"],"tags":["testing","integration-tests","test-aborted","connectivity","ci"],"backgroundTag":null,"analyzedSha":"878ce2a1fad54ca941d17fdcf2e1d924b148eb1f","analyzedAt":"2026-08-14T15:17:09.895Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}