Skip to content

Commit 323c0b5

Browse files
committed
fix: remove unintended changes
1 parent ae8b726 commit 323c0b5

File tree

9 files changed

+58
-54
lines changed

9 files changed

+58
-54
lines changed

cmd/config/cobra_test_exports.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func StartDefaultSystem(t *testing.T) SystemConfig {
4949
_, coordinator := mock.StartMockCoordinatorService(t)
5050
conn := dbtest.PrepareTestEnv(t)
5151
server := connection.NewLocalHostServerWithTLS(test.InsecureTLSConfig)
52-
listen, err := server.Listener(t.Context())
52+
listen, err := server.Listener()
5353
require.NoError(t, err)
5454
connection.CloseConnectionsLog(listen)
5555
return SystemConfig{

go.mod

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ go 1.24.3
99
require (
1010
github.com/cenkalti/backoff/v4 v4.3.0
1111
github.com/cockroachdb/errors v1.11.3
12-
github.com/consensys/gnark-crypto v0.18.1
12+
github.com/consensys/gnark-crypto v0.14.0
1313
github.com/docker/docker v28.0.0+incompatible
1414
github.com/docker/go-connections v0.5.0
1515
github.com/fsouza/go-dockerclient v1.12.0
@@ -46,18 +46,19 @@ require (
4646
github.com/IBM/idemix/bccsp/schemes/aries v0.0.0-20240913182345-72941a5f41cd // indirect
4747
github.com/IBM/idemix/bccsp/schemes/weak-bb v0.0.0-20240913182345-72941a5f41cd // indirect
4848
github.com/IBM/idemix/bccsp/types v0.0.0-20240913182345-72941a5f41cd // indirect
49-
github.com/IBM/mathlib v0.0.3-0.20250709075152-a138079496c3 // indirect
49+
github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da // indirect
5050
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible // indirect
5151
github.com/Microsoft/go-winio v0.6.2 // indirect
5252
github.com/beorn7/perks v1.0.1 // indirect
53-
github.com/bits-and-blooms/bitset v1.20.0 // indirect
53+
github.com/bits-and-blooms/bitset v1.14.3 // indirect
5454
github.com/bytedance/sonic v1.12.3 // indirect
5555
github.com/bytedance/sonic/loader v0.2.0 // indirect
5656
github.com/cespare/xxhash/v2 v2.3.0 // indirect
5757
github.com/cloudwego/base64x v0.1.4 // indirect
5858
github.com/cloudwego/iasm v0.2.0 // indirect
5959
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
6060
github.com/cockroachdb/redact v1.1.5 // indirect
61+
github.com/consensys/bavard v0.1.22 // indirect
6162
github.com/containerd/log v0.1.0 // indirect
6263
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
6364
github.com/distribution/reference v0.6.0 // indirect
@@ -98,6 +99,7 @@ require (
9899
github.com/leodido/go-urn v1.4.0 // indirect
99100
github.com/mattn/go-isatty v0.0.20 // indirect
100101
github.com/miekg/pkcs11 v1.1.1 // indirect
102+
github.com/mmcloughlin/addchain v0.4.0 // indirect
101103
github.com/moby/docker-image-spec v1.3.1 // indirect
102104
github.com/moby/patternmatcher v0.6.0 // indirect
103105
github.com/moby/sys/sequential v0.6.0 // indirect
@@ -147,4 +149,5 @@ require (
147149
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
148150
gopkg.in/yaml.v2 v2.4.0 // indirect
149151
gotest.tools/v3 v3.5.1 // indirect
152+
rsc.io/tmplfunc v0.0.3 // indirect
150153
)

go.sum

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -609,8 +609,8 @@ github.com/IBM/idemix/bccsp/schemes/weak-bb v0.0.0-20240913182345-72941a5f41cd h
609609
github.com/IBM/idemix/bccsp/schemes/weak-bb v0.0.0-20240913182345-72941a5f41cd/go.mod h1:OlxSkCgdOahDJzm8uyw45a9R7rehCC+0YGyh3gf0b40=
610610
github.com/IBM/idemix/bccsp/types v0.0.0-20240913182345-72941a5f41cd h1:KQzFMUQtrwJHKwwijxnQ8Lj2D7A+RnSll4Ugv20H3vQ=
611611
github.com/IBM/idemix/bccsp/types v0.0.0-20240913182345-72941a5f41cd/go.mod h1:4bYvi+a50aXxmHf1vwuvR+Wd8YXZ6AhT+0p5oK4xdOA=
612-
github.com/IBM/mathlib v0.0.3-0.20250709075152-a138079496c3 h1:TelnQIceKrhWVmuFnMXyKyq0WUG5zMT6u+7wnRMkcFY=
613-
github.com/IBM/mathlib v0.0.3-0.20250709075152-a138079496c3/go.mod h1:O230ebw6/22B7T4C03b99ZcPtc5XAfBTOp+ZT+xmMCk=
612+
github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da h1:qqGozq4tF6EOVnWoTgBoJGudRKKZXSAYnEtDggzTnsw=
613+
github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da/go.mod h1:Tco9QzE3fQzjMS7nPbHDeFfydAzctStf1Pa8hsh6Hjs=
614614
github.com/JohnCGriffin/overflow v0.0.0-20211019200055-46fa312c352c/go.mod h1:X0CRv0ky0k6m906ixxpzmDRLvX58TFUKS2eePweuyxk=
615615
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible h1:1G1pk05UrOh0NlF1oeaaix1x8XzrfjIDK47TY0Zehcw=
616616
github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0=
@@ -629,8 +629,8 @@ github.com/apache/arrow/go/v11 v11.0.0/go.mod h1:Eg5OsL5H+e299f7u5ssuXsuHQVEGC4x
629629
github.com/apache/thrift v0.16.0/go.mod h1:PHK3hniurgQaNMZYaCLEqXKsYK8upmhPbmdP2FXSqgU=
630630
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
631631
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
632-
github.com/bits-and-blooms/bitset v1.20.0 h1:2F+rfL86jE2d/bmw7OhqUg2Sj/1rURkBn3MdfoPyRVU=
633-
github.com/bits-and-blooms/bitset v1.20.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
632+
github.com/bits-and-blooms/bitset v1.14.3 h1:Gd2c8lSNf9pKXom5JtD7AaKO8o7fGQ2LtFj1436qilA=
633+
github.com/bits-and-blooms/bitset v1.14.3/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
634634
github.com/boombuler/barcode v1.0.0/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
635635
github.com/boombuler/barcode v1.0.1/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8=
636636
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce h1:YtWJF7RHm2pYCvA5t0RPmAaLUhREsKuKd+SLhxFbFeQ=
@@ -681,8 +681,10 @@ github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZe
681681
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs=
682682
github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30=
683683
github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
684-
github.com/consensys/gnark-crypto v0.18.1 h1:RyLV6UhPRoYYzaFnPQA4qK3DyuDgkTgskDdoGqFt3fI=
685-
github.com/consensys/gnark-crypto v0.18.1/go.mod h1:L3mXGFTe1ZN+RSJ+CLjUt9x7PNdx8ubaYfDROyp2Z8c=
684+
github.com/consensys/bavard v0.1.22 h1:Uw2CGvbXSZWhqK59X0VG/zOjpTFuOMcPLStrp1ihI0A=
685+
github.com/consensys/bavard v0.1.22/go.mod h1:k/zVjHHC4B+PQy1Pg7fgvG3ALicQw540Crag8qx+dZs=
686+
github.com/consensys/gnark-crypto v0.14.0 h1:DDBdl4HaBtdQsq/wfMwJvZNE80sHidrK3Nfrefatm0E=
687+
github.com/consensys/gnark-crypto v0.14.0/go.mod h1:CU4UijNPsHawiVGNxe9co07FkzCeWHHrb1li/n1XoU0=
686688
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
687689
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
688690
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
@@ -875,6 +877,7 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLe
875877
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA=
876878
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
877879
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
880+
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
878881
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
879882
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
880883
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
@@ -1041,6 +1044,9 @@ github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcs
10411044
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE=
10421045
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
10431046
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
1047+
github.com/mmcloughlin/addchain v0.4.0 h1:SobOdjm2xLj1KkXN5/n0xTIWyZA2+s99UCY1iPfkHRY=
1048+
github.com/mmcloughlin/addchain v0.4.0/go.mod h1:A86O+tHqZLMNO4w6ZZ4FlVQEadcoqkyU72HC5wJ4RlU=
1049+
github.com/mmcloughlin/profile v0.1.1/go.mod h1:IhHD7q1ooxgwTgjxQYkACGA77oFTDdFVejUS1/tS/qU=
10441050
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
10451051
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
10461052
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
@@ -2031,3 +2037,5 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8
20312037
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
20322038
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
20332039
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
2040+
rsc.io/tmplfunc v0.0.3 h1:53XFQh69AfOa8Tw0Jm7t+GV7KZhOi6jzsCzTtKbMvzU=
2041+
rsc.io/tmplfunc v0.0.3/go.mod h1:AG3sTPzElb1Io3Yg4voV9AGZJuleGAwaVRxL9M49PhA=

integration/runner/ports.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func (p *portAllocator) allocatePorts(t *testing.T, count int) []config.ServiceE
3535
func (p *portAllocator) allocate(t *testing.T) *connection.Endpoint {
3636
t.Helper()
3737
s := connection.NewLocalHostServerWithTLS(test.InsecureTLSConfig)
38-
listener, err := s.Listener(t.Context())
38+
listener, err := s.Listener()
3939
require.NoError(t, err)
4040
p.listeners = append(p.listeners, listener)
4141
return &s.Endpoint

utils/connection/client_util_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ func TestGRPCRetryMultiEndpoints(t *testing.T) {
139139

140140
t.Log("Creating fake service address")
141141
fakeServerConfig := connection.NewLocalHostServerWithTLS(test.InsecureTLSConfig)
142-
l, err := fakeServerConfig.Listener(t.Context())
142+
l, err := fakeServerConfig.Listener()
143143
require.NoError(t, err)
144144
t.Cleanup(func() {
145145
connection.CloseConnectionsLog(l)

utils/connection/server_util.go

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@ type (
3434
}
3535
)
3636

37-
var listenRetry = RetryProfile{
38-
InitialInterval: 50 * time.Millisecond,
39-
MaxInterval: 500 * time.Millisecond,
40-
MaxElapsedTime: 2 * time.Minute,
41-
}
42-
4337
// NewLocalHostServerWithTLS returns a default server config with endpoint "localhost:0" given server credentials.
4438
func NewLocalHostServerWithTLS(creds TLSConfig) *ServerConfig {
4539
return &ServerConfig{
@@ -76,23 +70,11 @@ func (c *ServerConfig) GrpcServer() (*grpc.Server, error) {
7670
}
7771

7872
// Listener instantiate a [net.Listener] and updates the config port with the effective port.
79-
// If the port is predefined, it will retry to bind to the port until successful or until the context ends.
80-
func (c *ServerConfig) Listener(ctx context.Context) (net.Listener, error) {
73+
func (c *ServerConfig) Listener() (net.Listener, error) {
8174
if c.preAllocatedListener != nil {
8275
return c.preAllocatedListener, nil
8376
}
84-
85-
var err error
86-
var listener net.Listener
87-
if c.Endpoint.Port == 0 {
88-
listener, err = net.Listen(grpcProtocol, c.Endpoint.Address())
89-
} else {
90-
err = listenRetry.Execute(ctx, func() error {
91-
var listenErr error
92-
listener, listenErr = net.Listen(grpcProtocol, c.Endpoint.Address())
93-
return listenErr
94-
})
95-
}
77+
listener, err := net.Listen(grpcProtocol, c.Endpoint.Address())
9678
if err != nil {
9779
return nil, errors.Wrap(err, "failed to listen")
9880
}
@@ -111,7 +93,7 @@ func (c *ServerConfig) Listener(ctx context.Context) (net.Listener, error) {
11193
// PreAllocateListener is used to allocate a port and bind to ahead of the server initialization.
11294
// It stores the listener object internally to be reused on subsequent calls to Listener().
11395
func (c *ServerConfig) PreAllocateListener() (net.Listener, error) {
114-
listener, err := c.Listener(context.Background())
96+
listener, err := c.Listener()
11597
if err != nil {
11698
return nil, err
11799
}
@@ -125,7 +107,7 @@ func RunGrpcServer(
125107
serverConfig *ServerConfig,
126108
register func(server *grpc.Server),
127109
) error {
128-
listener, err := serverConfig.Listener(ctx)
110+
listener, err := serverConfig.Listener()
129111
if err != nil {
130112
return err
131113
}

utils/deliver/client_test.go

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package deliver
88

99
import (
1010
"context"
11-
"net"
1211
"strings"
1312
"testing"
1413
"time"
@@ -51,7 +50,7 @@ func TestBroadcastDeliver(t *testing.T) {
5150
require.NoError(t, err)
5251
t.Cleanup(client.CloseConnections)
5352

54-
ctx, cancel := context.WithTimeout(t.Context(), 5*time.Minute)
53+
ctx, cancel := context.WithTimeout(t.Context(), time.Minute)
5554
t.Cleanup(cancel)
5655

5756
outputBlocksChan := make(chan *common.Block, 100)
@@ -78,21 +77,20 @@ func TestBroadcastDeliver(t *testing.T) {
7877

7978
t.Log("One server down")
8079
servers[2].Servers[0].Stop()
81-
listener1 := holdPort(ctx, t, servers[2].Configs[0])
80+
waitUntilGrpcServerIsDown(ctx, t, &servers[2].Configs[0].Endpoint)
8281
submit(t, &conf, outputBlocks, expectedSubmit{
8382
success: 3,
8483
})
8584

8685
t.Log("Two servers down")
8786
servers[2].Servers[1].Stop()
88-
listener2 := holdPort(ctx, t, servers[2].Configs[1])
87+
waitUntilGrpcServerIsDown(ctx, t, &servers[2].Configs[1].Endpoint)
8988
submit(t, &conf, outputBlocks, expectedSubmit{
9089
success: 2,
9190
unavailable: 1,
9291
})
9392

9493
t.Log("One incorrect server")
95-
_ = listener1.Close()
9694
fakeServer := test.RunGrpcServerForTest(ctx, t, servers[2].Configs[0], nil)
9795
waitUntilGrpcServerIsReady(ctx, t, &servers[2].Configs[0].Endpoint)
9896
submit(t, &conf, outputBlocks, expectedSubmit{
@@ -102,22 +100,22 @@ func TestBroadcastDeliver(t *testing.T) {
102100

103101
t.Log("All good again")
104102
fakeServer.Stop()
103+
waitUntilGrpcServerIsDown(ctx, t, &servers[2].Configs[0].Endpoint)
105104
servers[2].Servers[0] = test.RunGrpcServerForTest(ctx, t, servers[2].Configs[0], ordererService.RegisterService)
106105
waitUntilGrpcServerIsReady(ctx, t, &servers[2].Configs[0].Endpoint)
107106
submit(t, &conf, outputBlocks, expectedSubmit{
108107
success: 3,
109108
})
110109

111110
t.Log("Insufficient quorum")
112-
_ = listener2.Close()
113111
for _, gs := range servers[:2] {
114112
for _, s := range gs.Servers[:2] {
115113
s.Stop()
116114
}
117115
}
118116
for _, gs := range servers[:2] {
119117
for _, c := range gs.Configs[:2] {
120-
holdPort(ctx, t, c)
118+
waitUntilGrpcServerIsDown(ctx, t, &c.Endpoint)
121119
}
122120
}
123121
submit(t, &conf, outputBlocks, expectedSubmit{
@@ -233,17 +231,11 @@ func waitUntilGrpcServerIsReady(ctx context.Context, t *testing.T, endpoint *con
233231
t.Logf("%v is ready", endpoint)
234232
}
235233

236-
// holdPort attempts to bind to the specified server port and holds it until the listener is closed.
237-
// It serves two purposes:
238-
// 1. A successful bind indicates the port is free, meaning the server previously using it is down.
239-
// 2. It prevents other tests from binding to the same port, ensuring this test correctly detects the server as
240-
// unavailable.
241-
func holdPort(ctx context.Context, t *testing.T, c *connection.ServerConfig) net.Listener {
234+
func waitUntilGrpcServerIsDown(ctx context.Context, t *testing.T, endpoint *connection.Endpoint) {
242235
t.Helper()
243-
listener, err := c.Listener(ctx)
236+
newConn, err := connection.Connect(test.NewInsecureDialConfig(endpoint))
244237
require.NoError(t, err)
245-
t.Cleanup(func() {
246-
_ = listener.Close()
247-
})
248-
return listener
238+
defer connection.CloseConnectionsLog(newConn)
239+
test.WaitUntilGrpcServerIsDown(ctx, t, newConn)
240+
t.Logf("%v is down", endpoint)
249241
}

utils/monitoring/provider.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (p *Provider) StartPrometheusServer(
6262
Handler: mux,
6363
}
6464

65-
l, err := serverConfig.Listener(ctx)
65+
l, err := serverConfig.Listener()
6666
if err != nil {
6767
return err
6868
}

utils/test/utils.go

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ func RunGrpcServerForTest(
8080
ctx context.Context, tb testing.TB, serverConfig *connection.ServerConfig, register func(server *grpc.Server),
8181
) *grpc.Server {
8282
tb.Helper()
83-
listener, err := serverConfig.Listener(ctx)
83+
listener, err := serverConfig.Listener()
8484
require.NoError(tb, err)
8585
server, err := serverConfig.GrpcServer()
8686
require.NoError(tb, err)
@@ -221,6 +221,25 @@ func WaitUntilGrpcServerIsReady(
221221
require.Equal(t, healthgrpc.HealthCheckResponse_SERVING, res.Status)
222222
}
223223

224+
// WaitUntilGrpcServerIsDown uses the health check API to check a service is down.
225+
func WaitUntilGrpcServerIsDown(
226+
ctx context.Context,
227+
t *testing.T,
228+
conn grpc.ClientConnInterface,
229+
) {
230+
t.Helper()
231+
if conn == nil {
232+
return
233+
}
234+
healthClient := healthgrpc.NewHealthClient(conn)
235+
require.EventuallyWithT(t, func(ct *assert.CollectT) {
236+
checkCtx, cancel := context.WithTimeout(ctx, 5*time.Second)
237+
defer cancel()
238+
_, err := healthClient.Check(checkCtx, nil)
239+
require.Error(ct, err)
240+
}, time.Minute, 50*time.Millisecond)
241+
}
242+
224243
// StatusRetriever provides implementation retrieve status of given transaction identifiers.
225244
type StatusRetriever interface {
226245
GetTransactionsStatus(context.Context, *protoblocktx.QueryStatus, ...grpc.CallOption) (

0 commit comments

Comments
 (0)