-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Closed
Description
Description
The ClpMetadataDbSetUp test utility class currently uses hardcoded paths under /tmp/%s for test databases, which can potentially cause conflicts with local files or concurrent test runs.
Problem
In presto-clp/src/test/java/com/facebook/presto/plugin/clp/ClpMetadataDbSetUp.java, the database path is constructed as:
public static final String metadataDbUrlTemplate =
"jdbc:h2:file:/tmp/%s;MODE=MySQL;DATABASE_TO_UPPER=FALSE";This can lead to:
- Conflicts with existing local files
- Issues with concurrent test executions
- Unpredictable test behavior in CI/CD environments
Proposed Solution
Use a random UUID for better isolation, for example:
- Change the path pattern to
/tmp/clp-connector-{UUID} - Generate the UUID once per test session to maintain consistency across related tests
- Provide a method to retrieve this path for use in subsequent unit tests
Reference
This issue was identified and discussed in PR #15:
- PR: feat: Add coordinator implementation of CLP connector. y-scope/presto#15
- Comment thread: feat: Add coordinator implementation of CLP connector. y-scope/presto#15 (comment)
As mentioned in the discussion, this will be addressed in a future update to keep minimal changes in the current PR.
Metadata
Metadata
Assignees
Labels
No labels