Ma77Ball opened a new pull request, #5728:
URL: https://github.com/apache/texera/pull/5728

   ### What changes were proposed in this PR?
   - `PostgreSQLConnUtilSpec` / `MySQLConnUtilSpec` were flaky: they ran a 
multi-step sequence against the process-global `java.sql.DriverManager` 
registry (deregister the real driver, register a capturing stub, restore), and 
the module's tests run un-forked with sbt's default `parallelExecution = true`, 
so the suites raced any concurrent suite that touched JDBC in the same JVM.
   - Extracted the JDBC URL composition (the only application-controlled logic) 
into a pure `buildJdbcUrl(host, port, database)` in `PostgreSQLConnUtil` and 
`MySQLConnUtil`; the existing `connect` now calls it, so the public signature 
and runtime behavior are unchanged.
   - Rewrote both specs to assert URL composition directly on `buildJdbcUrl`, 
with no `DriverManager` mutation and no `BeforeAndAfterAll`, so the suites are 
deterministic under parallel execution.
   - Dropped the former `setReadOnly` / credential / `SQLException` assertions: 
those exercise JDBC plumbing rather than application logic and were what forced 
the global-registry manipulation behind the flake.
   ### Any related issues, documentation, discussions?
   Closes: #5727
   ### How was this PR tested?
   - Run `sbt "WorkflowOperator/testOnly *PostgreSQLConnUtilSpec 
*MySQLConnUtilSpec"` (under JDK 17); expect 12 tests succeeded, 0 failed across 
2 suites.
   - Run `sbt scalafmtCheckAll`; expect success (no formatting diffs).
   - The original race was timing-dependent and not reproducible on demand; the 
fix removes the shared `DriverManager` state entirely, so there is no longer 
cross-suite state to race. Reviewers can confirm by grepping the two specs for 
`DriverManager` and `BeforeAndAfterAll`, both now absent.
   ### Was this PR authored or co-authored using generative AI tooling?
   Co-authored with Claude Opus 4.8 in compliance with ASF
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to