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

Fix flaky GetTransactionLifecycleTest caused by slow CI #20116

Merged
merged 1 commit into from
Sep 13, 2021
Merged

Fix flaky GetTransactionLifecycleTest caused by slow CI #20116

merged 1 commit into from
Sep 13, 2021

Conversation

famod
Copy link
Member

@famod famod commented Sep 13, 2021

Fixes e.g.:

[INFO] Running io.quarkus.hibernate.orm.transaction.GetTransactionLifecycleTest
2021-09-12 22:20:01,773 WARN  [io.qua.net.run.NettyRecorder] (Thread-2169) Netty DefaultChannelId initialization (with io.netty.machineId system property set to 3e:4c:c3:3e:ed:0f:72:6a) took more than a second
2021-09-12 22:20:07,284 INFO  [io.quarkus] (main) Quarkus 999-SNAPSHOT on JVM started in 7.521s. Listening on: http://localhost:8081
2021-09-12 22:20:07,284 INFO  [io.quarkus] (main) Profile test activated. 
2021-09-12 22:20:07,284 INFO  [io.quarkus] (main) Installed features: [agroal, cdi, hibernate-orm, hibernate-validator, jdbc-h2, narayana-jta, smallrye-context-propagation, smallrye-metrics, vertx]
2021-09-12 22:20:07,663 INFO  [io.quarkus] (main) Quarkus stopped in 0.039s
[ERROR] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 8.581 s <<< FAILURE! - in io.quarkus.hibernate.orm.transaction.GetTransactionLifecycleTest
[ERROR] io.quarkus.hibernate.orm.transaction.GetTransactionLifecycleTest  Time elapsed: 8.581 s  <<< FAILURE!
java.lang.AssertionError: 

Expecting empty but was: ["Netty DefaultChannelId initialization (with io.netty.machineId system property set to 3e:4c:c3:3e:ed:0f:72:6a) took more than a second"]
	at io.quarkus.hibernate.orm.transaction.AbstractTransactionLifecycleTest.lambda$static$2(AbstractTransactionLifecycleTest.java:55)

#20080 (comment)

First I thought about removing the warning altogether:

// TODO: Remove this method (maybe in 1.6.x of Quarkus or later) if there are no user reports
// of the WARN message issued from this method. See comments in https://github.com/quarkusio/quarkus/pull/9246
// for details
public void eagerlyInitChannelId() {
//this class is slow to init and can block the IO thread and cause a warning
//we init it from a throwaway thread to stop this
//we do it from another thread so as not to affect start time
new Thread(new Runnable() {
@Override
public void run() {
long start = System.currentTimeMillis();
DefaultChannelId.newInstance();
if (System.currentTimeMillis() - start > 1000) {
log.warn("Netty DefaultChannelId initialization (with io.netty.machineId" +
" system property set to " + System.getProperty("io.netty.machineId")
+ ") took more than a second");
}
}
}).start();
}

but we do see user logs with that from time to time:

@quarkus-bot quarkus-bot bot added area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE labels Sep 13, 2021
@gastaldi gastaldi added the triage/waiting-for-ci Ready to merge when CI successfully finishes label Sep 13, 2021
@famod famod merged commit db2f6b5 into quarkusio:main Sep 13, 2021
@quarkus-bot quarkus-bot bot added this to the 2.3 - main milestone Sep 13, 2021
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Sep 13, 2021
@famod famod deleted the fix-GetTransactionLifecycleTest-flakiness branch September 13, 2021 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/hibernate-orm Hibernate ORM area/persistence OBSOLETE, DO NOT USE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants