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

Disable SpringHibernate2lcApplicationTest [DI-336] #685

Merged
merged 7 commits into from
Nov 14, 2024

Conversation

nishaatr
Copy link
Contributor

@nishaatr nishaatr commented Nov 13, 2024

Disable test temporarily until DI-338 is fixed

We have migrated Code Samples PR builder to GitHub (#674) and Hazelcast is activating Azure identity provider (likely as GH hosted runners run in Azure) which results in the test hanging by continuously attempting to connect to HZ cluster (which likely failed to start)

The test emits Azure warning in the build log:

2024-11-12T13:09:27.618Z  INFO 3599 --- [spring-hazelcast-hibernate-2lc] [           main] com.hazelcast.core.LifecycleService      : [10.1.0.75]:5701 [dev] [5.5.0] [10.1.0.75]:5701 is STARTING
2024-11-12T13:09:27.654Z  WARN 3599 --- [spring-hazelcast-hibernate-2lc] [           main] c.h.azure.AzureDiscoveryStrategy         : No Azure credentials found! Starting standalone. To use Hazelcast Azure discovery, configure properties (client-id, tenant-id, client-secret) or assign a managed identity to the Azure Compute instance
2024-11-12T13:09:32.905Z  INFO 3599 --- [spring-hazelcast-hibernate-2lc] [           main] c.h.internal.cluster.ClusterService      : [10.1.0.75]:5701 [dev] [5.5.0] 

A little later the test hangs repeatedly connecting to cluster

2024-11-12T13:09:33.847Z  WARN 3599 --- [spring-hazelcast-hibernate-2lc] [           main] c.h.azure.AzureDiscoveryStrategy         : No Azure credentials found! Starting standalone. To use Hazelcast Azure discovery, configure properties (client-id, tenant-id, client-secret) or assign a managed identity to the Azure Compute instance
2024-11-12T13:09:33.847Z  WARN 3599 --- [spring-hazelcast-hibernate-2lc] [           main] c.h.c.i.c.ClientConnectionManager        : hz.client_1 [dev] [5.5.0] Unable to get live cluster connection, retry in 2000 ms, attempt: 1, cluster connect timeout: 2147483647 ms, max backoff: 35000 ms
2024-11-12T13:09:35.855Z  WARN 3599 --- [spring-hazelcast-hibernate-2lc] [           main] c.h.c.i.c.ClientConnectionManager        : hz.client_1 [dev] [5.5.0] Unable to get live cluster connection, retry in 3000 ms, attempt: 2, cluster connect timeout: 2147483647 ms, max backoff: 35000 ms
2024-11-12T13:09:38.866Z  WARN 3599 --- [spring-hazelcast-hibernate-2lc] [           main] c.h.c.i.c.ClientConnectionManager        : hz.client_1 [dev] [5.5.0] Unable to get live cluster connection, retry in 4500 ms, attempt: 3, cluster connect timeout: 2147483647 ms, max backoff: 35000 ms
2024-11-12T13:09:43.376Z  WARN 3599 --- [spring-hazelcast-hibernate-2lc] [           main] c.h.c.i.c.ClientConnectionManager        : hz.client_1 [dev] [5.5.0] Unable to g

This might take effort to fix so disabling for now is the simplest option

Note: Tried using @ignore(...) on the test but didn't take effect for some reason so resorted to disabling via POM. This is the only test at the moment

@nishaatr nishaatr changed the title Update SpringHibernate2lcApplicationTest.java Disable SpringHibernate2lcApplicationTest [DI-336] Nov 13, 2024
@nishaatr nishaatr changed the title Disable SpringHibernate2lcApplicationTest [DI-336] Disable SpringHibernate2lcApplicationTest [DI-336][DI-338] Nov 13, 2024
@nishaatr nishaatr changed the title Disable SpringHibernate2lcApplicationTest [DI-336][DI-338] Disable SpringHibernate2lcApplicationTest [DI-336] Nov 13, 2024
Copy link
Contributor

@JackPGreen JackPGreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can’t you @ignore the specified test instead?

An explanation would help, too.

@nishaatr
Copy link
Contributor Author

nishaatr commented Nov 13, 2024

Can’t you @ignore the specified test instead?

Tried but didn't seem to take effect for some reason so resorted to POM. This is the only test at the moment. Already mentioned in DI-338

An explanation would help, too.

Sure. will add shortly

@JackPGreen
Copy link
Contributor

JackPGreen commented Nov 13, 2024

Can’t you @ignore the specified test instead?

Tried but didn't seem to take effect for some reason so resorted to POM. This is the only test at the moment. Already mentioned in DI-338

It’s the solution I’d rather see. What didn’t work?

@nishaatr
Copy link
Contributor Author

nishaatr commented Nov 13, 2024

Can’t you @ignore the specified test instead?

Tried but didn't seem to take effect for some reason so resorted to POM. This is the only test at the moment. Already mentioned in DI-338

It’s the solution I’d rather see. What didn’t work?

Same here and thats why I tried it. The test ran regardless and build hanged again. I see 3 other tests using @ignore and they are getting skipped but not for this.

I could try again and may be you can help but prefer to merge to timebox the effort

@JackPGreen
Copy link
Contributor

I tried it. The test ran regardless and build hanged again. I see 3 other tests using @ignore and they are getting skipped but not for this.

  • you need to import the annotation, otherwise it'll throw a compilation error
  • it's a JUnit5 test, so you need the JUnit5 version - @Disabled
diff --git a/hazelcast-integration/spring-hibernate-2ndlevel-cache/src/test/java/com/hazelcast/hibernate/springhibernate2lc/SpringHibernate2lcApplicationTest.java b/hazelcast-integration/spring-hibernate-2ndlevel-cache/src/test/java/com/hazelcast/hibernate/springhibernate2lc/SpringHibernate2lcApplicationTest.java
index cf0cc161..f4af3731 100644
--- a/hazelcast-integration/spring-hibernate-2ndlevel-cache/src/test/java/com/hazelcast/hibernate/springhibernate2lc/SpringHibernate2lcApplicationTest.java
+++ b/hazelcast-integration/spring-hibernate-2ndlevel-cache/src/test/java/com/hazelcast/hibernate/springhibernate2lc/SpringHibernate2lcApplicationTest.java
@@ -8,6 +8,7 @@ import jakarta.persistence.EntityManager;
 import org.hibernate.Session;
 import org.hibernate.Version;
 import org.hibernate.stat.Statistics;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -37,6 +38,7 @@ class SpringHibernate2lcApplicationTest {
 	@Autowired
 	private EntityManager entityManager;
 
+	@Disabled
 	@Test
 	void testCaching() {
 		logger.warn("Hazelcast: " + BuildInfoProvider.getBuildInfo().getVersion());

@nishaatr
Copy link
Contributor Author

  • you need to import the annotation, otherwise it'll throw a compilation error

Did that here

  • it's a JUnit5 test, so you need the JUnit5 version - @Disabled

I did actually but that was before the checkout PR fix I did earlier. I will try. thanks

@nishaatr
Copy link
Contributor Author

I did actually but that was before the checkout PR fix I did earlier. I will try. thanks

Worked. thanks

@nishaatr nishaatr merged commit 8117096 into hazelcast:master Nov 14, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants