The GitHub Actions job "MySQL Integration Tests" on 
pekko-persistence-jdbc.git/main has succeeded.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
9a3893f6a1c1380fd1239ae9860f35ed8f18cefb / PJ Fanning 
<[email protected]>
Stop a timed-out migrator test from leaking into the next one (#610)

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 the migration 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 race with the migration that is still in flight.

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 the migration once in `JournalMigratorTest` and `SnapshotMigratorTest`,
  keeping `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 a 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/34202071684

With regards,
GitHub Actions via GitBox


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

Reply via email to