mirror of
https://github.com/gomods/athens
synced 2026-02-03 12:10:32 +00:00
fix flake on redis-sentinel by depending on redis container / step. (#1748)
* fix: flake on redis-sentinel by depending on redis container / step. Signed-off-by: Manu Gupta <manugupt1@gmail.com> * Add retries in an attempt to reduce the number of flakes Also; update go-redis. Co-authored-by: Aaron Schlesinger <70865+arschles@users.noreply.github.com>
This commit is contained in:
@@ -69,6 +69,9 @@ steps:
|
||||
volumes:
|
||||
- name: cache
|
||||
path: /go
|
||||
depends_on:
|
||||
- redis
|
||||
- redis-sentinel
|
||||
|
||||
- name: docker-latest
|
||||
image: plugins/docker
|
||||
@@ -169,6 +172,8 @@ services:
|
||||
REDIS_SENTINEL_QUORUM: "1"
|
||||
ports:
|
||||
- 26379
|
||||
depends_on:
|
||||
- redis
|
||||
- name: protectedredis
|
||||
image: redis
|
||||
ports:
|
||||
|
||||
@@ -90,6 +90,8 @@ services:
|
||||
- REDIS_SENTINEL_QUORUM=1
|
||||
ports:
|
||||
- 26379:26379
|
||||
depends_on:
|
||||
- "redis"
|
||||
protectedredis:
|
||||
image: redis
|
||||
ports:
|
||||
|
||||
@@ -18,7 +18,7 @@ require (
|
||||
github.com/fatih/color v1.7.0
|
||||
github.com/go-playground/locales v0.12.1 // indirect
|
||||
github.com/go-playground/universal-translator v0.16.0 // indirect
|
||||
github.com/go-redis/redis/v7 v7.2.0
|
||||
github.com/go-redis/redis/v7 v7.4.1
|
||||
github.com/go-sql-driver/mysql v1.5.0
|
||||
github.com/gobuffalo/envy v1.7.0
|
||||
github.com/gobuffalo/httptest v1.0.4
|
||||
|
||||
@@ -117,6 +117,8 @@ github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEK
|
||||
github.com/go-redis/redis/v7 v7.0.0-beta.4/go.mod h1:xhhSbUMTsleRPur+Vgx9sUHtyN33bdjxY+9/0n9Ig8s=
|
||||
github.com/go-redis/redis/v7 v7.2.0 h1:CrCexy/jYWZjW0AyVoHlcJUeZN19VWlbepTh1Vq6dJs=
|
||||
github.com/go-redis/redis/v7 v7.2.0/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
|
||||
github.com/go-redis/redis/v7 v7.4.1 h1:PASvf36gyUpr2zdOUS/9Zqc80GbM+9BDyiJSJDDOrTI=
|
||||
github.com/go-redis/redis/v7 v7.4.1/go.mod h1:JDNMw23GTyLNC4GZu9njt15ctBQVn7xjRfnwdHj/Dcg=
|
||||
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
|
||||
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
|
||||
|
||||
@@ -26,9 +26,20 @@ func TestWithRedisSentinelLock(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
ms := &mockRedisStasher{strg: strg}
|
||||
wrapper, err := WithRedisSentinelLock([]string{endpoint}, masterName, password, storage.WithChecker(strg))
|
||||
|
||||
// retries because of flaky test on drone.
|
||||
var wrapper Wrapper
|
||||
for i := 1; i <= 3; i++ {
|
||||
wrapper, err = WithRedisSentinelLock([]string{endpoint}, masterName, password, storage.WithChecker(strg))
|
||||
if err != nil {
|
||||
t.Logf("Retried %d time because we got error: %s", i, err.Error())
|
||||
}
|
||||
time.Sleep(1 * time.Second)
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
t.Fatalf("Please file an issue at https://github.com/gomods/athens/issues as the "+
|
||||
"test flake is not fixed. The error that occured was: %s", err)
|
||||
}
|
||||
s := wrapper(ms)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user