Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate flaky Flyway test #28618

Closed
gastaldi opened this issue Oct 15, 2022 · 6 comments · Fixed by #28642
Closed

Investigate flaky Flyway test #28618

gastaldi opened this issue Oct 15, 2022 · 6 comments · Fixed by #28642
Assignees
Milestone

Comments

@gastaldi
Copy link
Contributor

gastaldi commented Oct 15, 2022

There's something fishy with Flyway lately:

2022-10-14T23:15:00.4215101Z Caused by: java.lang.RuntimeException: Failed to start quarkus
2022-10-14T23:15:00.4215480Z 	at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
2022-10-14T23:15:00.4215875Z 	at io.quarkus.runtime.Application.start(Application.java:101)
2022-10-14T23:15:00.4216406Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2022-10-14T23:15:00.4216956Z 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
2022-10-14T23:15:00.4217570Z 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2022-10-14T23:15:00.4218056Z 	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
2022-10-14T23:15:00.4218493Z 	at io.quarkus.runner.bootstrap.StartupActionImpl.run(StartupActionImpl.java:237)
2022-10-14T23:15:00.4218960Z 	at io.quarkus.test.QuarkusUnitTest.beforeAll(QuarkusUnitTest.java:642)
2022-10-14T23:15:00.4219274Z 	... 43 more
2022-10-14T23:15:00.4219665Z Caused by: org.flywaydb.core.api.exception.FlywayValidateException: Validate failed: Migrations have failed validation
2022-10-14T23:15:00.4220118Z Migration checksum mismatch for migration version 1.0.0
2022-10-14T23:15:00.4220667Z -> Applied to database : 156834024
2022-10-14T23:15:00.4220964Z -> Resolved locally    : -986920762
2022-10-14T23:15:00.4221294Z Either revert the changes to the migration, or run repair to update the schema history.
2022-10-14T23:15:00.4221716Z Need more flexibility with validation rules? Learn more: https://rd.gt/3AbJUZE
2022-10-14T23:15:00.4222091Z 	at org.flywaydb.core.Flyway.lambda$migrate$0(Flyway.java:134)
2022-10-14T23:15:00.4222714Z 	at org.flywaydb.core.FlywayExecutor.execute(FlywayExecutor.java:204)
2022-10-14T23:15:00.4223102Z 	at org.flywaydb.core.Flyway.migrate(Flyway.java:128)
2022-10-14T23:15:00.4223538Z 	at io.quarkus.flyway.runtime.FlywayRecorder.doStartActions(FlywayRecorder.java:79)
2022-10-14T23:15:00.4224040Z 	at io.quarkus.deployment.steps.FlywayProcessor$startActions1770701860.deploy_0(Unknown Source)
2022-10-14T23:15:00.4224543Z 	at io.quarkus.deployment.steps.FlywayProcessor$startActions1770701860.deploy(Unknown Source)
2022-10-14T23:15:00.4224880Z 	... 51 more

/cc @gastaldi if you have an idea.

Originally posted by @gsmet in #28613 (comment)

@quarkus-bot
Copy link

quarkus-bot bot commented Oct 15, 2022

/cc @cristhiank, @geoand, @gsmet

@gastaldi gastaldi self-assigned this Oct 15, 2022
@gastaldi
Copy link
Contributor Author

Those error messages are expected and are part of the io.quarkus.flyway.test.FlywayExtensionRepairAtStartTest test

@geoand
Copy link
Contributor

geoand commented Oct 17, 2022

But they shouldn't be making the whole test fail, right?

@gastaldi
Copy link
Contributor Author

Exactly, I'm still investigating what's causing the test failures. Weird is that I see these error messages but the build doesn't fail for me locally

gastaldi added a commit to gastaldi/quarkus that referenced this issue Oct 17, 2022
@gsmet
Copy link
Member

gsmet commented Oct 17, 2022

Could it be because of the order in which the tests are executed? Might be worth to order them alphabetically then in reverse order and see how things go.

gastaldi added a commit to gastaldi/quarkus that referenced this issue Oct 17, 2022
@gastaldi
Copy link
Contributor Author

I don't see a way to test in reverse order, so I ran with these settings a couple of times and saw some failures. This PR seems to have fixed them:

mvn test -Djunit.jupiter.testmethod.order.default=org.junit.jupiter.api.MethodOrderer\$Random -Djunit.jupiter.testclass.order.default=org.junit.jupiter.api.ClassOrderer\$Random

@quarkus-bot quarkus-bot bot added this to the 2.14 - main milestone Oct 17, 2022
@gsmet gsmet modified the milestones: 2.14 - main, 2.13.3.Final Oct 18, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Oct 18, 2022
- Fixes quarkusio#28618

(cherry picked from commit afcb4e6)
tmihalac pushed a commit to tmihalac/quarkus that referenced this issue Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants