pjfanning opened a new pull request, #1978:
URL: https://github.com/apache/pekko-connectors/pull/1978

   ### Motivation
   `SlickWithTryResultSpec` › "insert 40 records into a table with try (no 
parallelism)" timed out at its 3 second patience 
([example](https://github.com/apache/pekko-connectors/actions/runs/36731431219/job/109941785162?pr=1976)).
 Nothing was logged during those 3 seconds. The same 40 inserts took 569ms in 
the previous test, and every later test finished in under a second, so this was 
a stall rather than a slow test. It wasn't a database error either: `flowTry` 
would have returned that as a `Failure`.
   
   The `slick-h2` test config sets `connectionPool = disabled` and uses a 
file-based H2 database. Every `db.run` therefore opens a new connection, and by 
default H2 closes the database file when the last connection closes and reopens 
it on the next connect. That per-statement file churn is the likely source of 
the stall on slow CI disks. The log can't prove this.
   
   ### Modification
   - Add a test-only override after the `#config-h2` doc snippet that appends 
`;DB_CLOSE_DELAY=-1` to the H2 URL, so the database stays open between 
connections. The config shown in the docs is unchanged.
   - Raise the `ScalaFutures` patience in `SlickSpec` and 
`SlickWithTryResultSpec` from 3 to 10 seconds. The Java `SlickTest` already 
waits 5 seconds.
   
   ### Result
   The H2 database is no longer closed and reopened between statements, and an 
occasional slow statement no longer fails the specs.
   
   ### Tests
   - `sbt slick/Test/scalafmt slick/test`: `Passed: Total 47, Failed 0`
   - Checked that the resolved `slick-h2.db.properties.url` ends with 
`;DB_CLOSE_DELAY=-1`
   
   ### References
   None - flaky CI run linked above


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to