Unable to connect to localhost:6379

I used the Redis service in my gitlab-ci.
And the pipeline doesn’t pass correctly and it has this error:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘enableRedisKeyspaceNotificationsInitializer’ defined in class path resource [org/springframework/session/data/redis/config/annotation/web/http/RedisHttpSessionConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to localhost:6379

Also, I don’t add Host and Port in my gitlab-ci. Because I use the gitlab runner.

What can I do to get rid of this error?