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(jedis-test): replace use of io.spinnaker.embedded-redis:embe… #1116

Merged
merged 1 commit into from
Nov 10, 2023

Conversation

dbyron-sf
Copy link
Contributor

…dded-redis with testcontainers

so we no longer need to maintain https://github.com/spinnaker/embedded-redis

and because after upgrading my mac to Sonoma (14.1), I see test failures with:

Caused by:
 java.lang.RuntimeException: Can't start redis server. Check logs for details.
     at redis.embedded.AbstractRedisInstance.awaitRedisServerReady(AbstractRedisInstance.java:60)
     at redis.embedded.AbstractRedisInstance.start(AbstractRedisInstance.java:36)
     at redis.embedded.RedisServer.start(RedisServer.java:9)
     at com.netflix.spinnaker.kork.jedis.EmbeddedRedis.<init>(EmbeddedRedis.java:29)
     at com.netflix.spinnaker.kork.jedis.EmbeddedRedis.embed(EmbeddedRedis.java:65)
     at com.netflix.spinnaker.kork.jedis.EmbeddedRedis$embed.call(Unknown Source)

The OS upgrade may not be the cause, but testcontainers works, and is generally a cleaner solution, so let's use it.

Change the return value of getPool to the more specific JedisPool (from Pool) so it's useful by e.g. gate's RedisTestConfig class.

Note that embedded-redis 0.9 was using version 4.0.10 of redis. Use 5-alpine to match fiat.

…dded-redis with testcontainers

so we no longer need to maintain https://github.com/spinnaker/embedded-redis

and because after upgrading my mac to Sonoma (14.1), I see test failures with:

Caused by:
 java.lang.RuntimeException: Can't start redis server. Check logs for details.
     at redis.embedded.AbstractRedisInstance.awaitRedisServerReady(AbstractRedisInstance.java:60)
     at redis.embedded.AbstractRedisInstance.start(AbstractRedisInstance.java:36)
     at redis.embedded.RedisServer.start(RedisServer.java:9)
     at com.netflix.spinnaker.kork.jedis.EmbeddedRedis.<init>(EmbeddedRedis.java:29)
     at com.netflix.spinnaker.kork.jedis.EmbeddedRedis.embed(EmbeddedRedis.java:65)
     at com.netflix.spinnaker.kork.jedis.EmbeddedRedis$embed.call(Unknown Source)

The OS upgrade may not be the cause, but testcontainers works, and is generally a cleaner solution, so let's use it.

Change the return value of getPool to the more specific JedisPool (from Pool<Jedis>) so
it's useful by e.g. gate's RedisTestConfig class.

Note that embedded-redis 0.9 was using version [4.0.10 of redis](https://github.com/spinnaker/embedded-redis/blob/v0.9.0/src/main/java/redis/embedded/RedisExecProvider.java#L30-L34).  Use 5-alpine to match [fiat](https://github.com/spinnaker/fiat/blob/b64c9ea249bd262c84a7421faf071cabdd3fdf77/fiat-web/src/test/groovy/com/netflix/spinnaker/config/RedisContainerConfig.groovy#L35).
Copy link
Member

@nemesisOsorio nemesisOsorio left a comment

Choose a reason for hiding this comment

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

LGTM

@dbyron-sf dbyron-sf added the ready to merge Approved and ready for merge label Nov 10, 2023
@mergify mergify bot added the auto merged label Nov 10, 2023
@mergify mergify bot merged commit 5403c6a into spinnaker:master Nov 10, 2023
5 checks passed
@dbyron-sf dbyron-sf deleted the redis-with-testcontainers branch November 10, 2023 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants