The GitHub Actions job "MySQL Integration Tests" on 
pekko-persistence-jdbc.git/migrator-test-fixture-leak has failed.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
04ba9933fe3bc1a8332b32a2033d2275e4d0cf5a / PJ Fanning 
<[email protected]>
Stop a timed-out migrator test from leaking into the next one

Motivation:
The SqlServer migrator integration tests failed on main when the runner was
slow. `should migrate the event journal preserving the order of events` hit the
10 second PatienceConfig while migrating 3000 events, and
`should migrate the event journal preserving tags` then failed with
`262 was not equal to 0` on its pre-migration count.

The second failure is fallout from the first. `withActorSystem` called
`system.terminate()` after the test body instead of in a `finally`, so a failing
body left the actor system running. Its in-flight migration stream kept writing
while the next test recreated the tables in `beforeEach`, and those 262 rows
landed in the fresh table.

The 10 second budget was also too tight. The last green run of the same job
spent 7.3 seconds in that phase, so a moderately slower runner is enough to
cross it.

Wrapping `migrate()` in `eventually` does not help either: the first
`futureValue` consumes the whole patience window, so there is never a second
attempt, and a retry would insert the migrated rows twice.

Modification:
- Terminate the actor system in a `finally` block in both `withActorSystem` and
  `withLegacyActorSystem`.
- Raise the migrator `PatienceConfig` timeout from 10 to 30 seconds.
- Call `migrate()` once in `JournalMigratorTest` and keep `eventually` only
  around the row-count assertion that follows it.
- Add `MigratorSpecFixtureTest` covering the fixture lifecycle contract.

Result:
A slow migration no longer corrupts the following test, and the migration is
never run concurrently with itself.

Tests:
- sbt "migratorIntegration/Test/testOnly 
org.apache.pekko.persistence.jdbc.migrator.H2JournalMigratorTest 
org.apache.pekko.persistence.jdbc.migrator.H2SnapshotMigratorTest 
org.apache.pekko.persistence.jdbc.migrator.MigratorSpecFixtureTest" - 6 
succeeded, 0 failed
- MigratorSpecFixtureTest with the `finally` reverted - both tests fail, 
confirming the fixture leak
- sbt "migratorIntegration/scalafmtAll" and 
"migratorIntegration/headerCreateAll" - run, no further changes
- The SqlServer, Postgres, MySQL and Oracle migrator tests need running 
database servers and were left to CI

References:
Refs 
https://github.com/apache/pekko-persistence-jdbc/actions/runs/34093026922/job/101650378069,
 Refs #192

Report URL: 
https://github.com/apache/pekko-persistence-jdbc/actions/runs/34097174452

With regards,
GitHub Actions via GitBox


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

Reply via email to