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

refactor(test): add EmbeddedRedis to get connection pool for test execution during upgrade to spring boot 2.7.x #1800

Closed
wants to merge 1 commit into from

Conversation

j-sandy
Copy link
Contributor

@j-sandy j-sandy commented Jun 3, 2024

While upgrading spring boot 2.7.18, encounter below error during test compilation of gate-web module:

Unexpected exception thrown: java.lang.AssertionError:
Expecting:
 <Unstarted application context org.springframework.boot.test.context.assertj.AssertableApplicationContext[startupFailure=org.springframework.context.ApplicationContextException]>
to get beans of type:
 <org.springframework.session.data.redis.config.ConfigureRedisAction>:
but context failed to start:
 org.springframework.context.ApplicationContextException: Failed to start bean 'springSessionRedisMessageListenerContainer'; nested exception is org.springframework.data.redis.listener.adapter.RedisListenerExecutionFailedException: org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

The com.netflix.spinnaker.gate.config.RedisConfigTest.testCircularDependenciesException and com.netflix.spinnaker.gate.config.RedisConfigTest.testCircularDependenciesExceptionSecure tests generated the above error. The root cause is unavailability of redis resource pool. So, adding EmbeddedRedis to provide resource pool during test execution.

…cution during upgrade to spring boot 2.7.x

While upgrading spring boot 2.7.18, encounter below error during test compilation of gate-web module:
```
Unexpected exception thrown: java.lang.AssertionError:
Expecting:
 <Unstarted application context org.springframework.boot.test.context.assertj.AssertableApplicationContext[startupFailure=org.springframework.context.ApplicationContextException]>
to get beans of type:
 <org.springframework.session.data.redis.config.ConfigureRedisAction>:
but context failed to start:
 org.springframework.context.ApplicationContextException: Failed to start bean 'springSessionRedisMessageListenerContainer'; nested exception is org.springframework.data.redis.listener.adapter.RedisListenerExecutionFailedException: org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Cannot get Jedis connection; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
```
The `com.netflix.spinnaker.gate.config.RedisConfigTest.testCircularDependenciesException` and `com.netflix.spinnaker.gate.config.RedisConfigTest.testCircularDependenciesExceptionSecure` tests generated the above error. The root cause is unavailability of redis resource pool. So, adding EmbeddedRedis to provide resource pool during test execution.
@j-sandy j-sandy marked this pull request as ready for review June 5, 2024 11:33
@dbyron-sf
Copy link
Contributor

included in #1804

@dbyron-sf dbyron-sf closed this Jun 12, 2024
@j-sandy j-sandy deleted the redis-sb-2-7-18 branch June 13, 2024 06:16
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