Skip to content

Commit 9166d31

Browse files
authored
Merge branch 'main' into utils-unit-test2
2 parents afd05d4 + 10a6c98 commit 9166d31

File tree

9 files changed

+54
-58
lines changed

9 files changed

+54
-58
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()
52+
listen, err := server.Listener(t.Context())
5353
require.NoError(t, err)
5454
connection.CloseConnectionsLog(listen)
5555
return SystemConfig{

go.mod

Lines changed: 3 additions & 6 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.14.0
12+
github.com/consensys/gnark-crypto v0.18.1
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,19 +46,18 @@ 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.20231011094432-44ee0eb539da // indirect
49+
github.com/IBM/mathlib v0.0.3-0.20250709075152-a138079496c3 // 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.14.3 // indirect
53+
github.com/bits-and-blooms/bitset v1.20.0 // 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
6261
github.com/containerd/log v0.1.0 // indirect
6362
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
6463
github.com/distribution/reference v0.6.0 // indirect
@@ -99,7 +98,6 @@ require (
9998
github.com/leodido/go-urn v1.4.0 // indirect
10099
github.com/mattn/go-isatty v0.0.20 // indirect
101100
github.com/miekg/pkcs11 v1.1.1 // indirect
102-
github.com/mmcloughlin/addchain v0.4.0 // indirect
103101
github.com/moby/docker-image-spec v1.3.1 // indirect
104102
github.com/moby/patternmatcher v0.6.0 // indirect
105103
github.com/moby/sys/sequential v0.6.0 // indirect
@@ -149,5 +147,4 @@ require (
149147
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
150148
gopkg.in/yaml.v2 v2.4.0 // indirect
151149
gotest.tools/v3 v3.5.1 // indirect
152-
rsc.io/tmplfunc v0.0.3 // indirect
153150
)

go.sum

Lines changed: 6 additions & 14 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.20231011094432-44ee0eb539da h1:qqGozq4tF6EOVnWoTgBoJGudRKKZXSAYnEtDggzTnsw=
613-
github.com/IBM/mathlib v0.0.3-0.20231011094432-44ee0eb539da/go.mod h1:Tco9QzE3fQzjMS7nPbHDeFfydAzctStf1Pa8hsh6Hjs=
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=
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.14.3 h1:Gd2c8lSNf9pKXom5JtD7AaKO8o7fGQ2LtFj1436qilA=
633-
github.com/bits-and-blooms/bitset v1.14.3/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
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=
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,10 +681,8 @@ 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/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=
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=
688686
github.com/containerd/log v0.1.0 h1:TCJt7ioM2cr/tfR8GPbGf9/VRAX8D2B4PjzCpfX540I=
689687
github.com/containerd/log v0.1.0/go.mod h1:VRRf09a7mHDIRezVKTRCrOq78v577GXq3bSa3EhrzVo=
690688
github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
@@ -877,7 +875,6 @@ github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLe
877875
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA=
878876
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
879877
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
880-
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
881878
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
882879
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
883880
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
@@ -1044,9 +1041,6 @@ github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcs
10441041
github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE=
10451042
github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
10461043
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=
10501044
github.com/moby/docker-image-spec v1.3.1 h1:jMKff3w6PgbfSa69GfNg+zN/XLhfXJGnEx3Nl2EsFP0=
10511045
github.com/moby/docker-image-spec v1.3.1/go.mod h1:eKmb5VW8vQEh/BAr2yvVNvuiJuY6UIocYsFu/DxxRpo=
10521046
github.com/moby/patternmatcher v0.6.0 h1:GmP9lR19aU5GqSSFko+5pRqHi+Ohk1O69aFiKkVGiPk=
@@ -2037,5 +2031,3 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8
20372031
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
20382032
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
20392033
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()
38+
listener, err := s.Listener(t.Context())
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()
142+
l, err := fakeServerConfig.Listener(t.Context())
143143
require.NoError(t, err)
144144
t.Cleanup(func() {
145145
connection.CloseConnectionsLog(l)

utils/connection/server_util.go

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ 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+
3743
// NewLocalHostServerWithTLS returns a default server config with endpoint "localhost:0" given server credentials.
3844
func NewLocalHostServerWithTLS(creds TLSConfig) *ServerConfig {
3945
return &ServerConfig{
@@ -70,11 +76,23 @@ func (c *ServerConfig) GrpcServer() (*grpc.Server, error) {
7076
}
7177

7278
// Listener instantiate a [net.Listener] and updates the config port with the effective port.
73-
func (c *ServerConfig) Listener() (net.Listener, error) {
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) {
7481
if c.preAllocatedListener != nil {
7582
return c.preAllocatedListener, nil
7683
}
77-
listener, err := net.Listen(grpcProtocol, c.Endpoint.Address())
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+
}
7896
if err != nil {
7997
return nil, errors.Wrap(err, "failed to listen")
8098
}
@@ -93,7 +111,7 @@ func (c *ServerConfig) Listener() (net.Listener, error) {
93111
// PreAllocateListener is used to allocate a port and bind to ahead of the server initialization.
94112
// It stores the listener object internally to be reused on subsequent calls to Listener().
95113
func (c *ServerConfig) PreAllocateListener() (net.Listener, error) {
96-
listener, err := c.Listener()
114+
listener, err := c.Listener(context.Background())
97115
if err != nil {
98116
return nil, err
99117
}
@@ -107,7 +125,7 @@ func RunGrpcServer(
107125
serverConfig *ServerConfig,
108126
register func(server *grpc.Server),
109127
) error {
110-
listener, err := serverConfig.Listener()
128+
listener, err := serverConfig.Listener(ctx)
111129
if err != nil {
112130
return err
113131
}

utils/deliver/client_test.go

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

99
import (
1010
"context"
11+
"net"
1112
"strings"
1213
"testing"
1314
"time"
@@ -50,7 +51,7 @@ func TestBroadcastDeliver(t *testing.T) {
5051
require.NoError(t, err)
5152
t.Cleanup(client.CloseConnections)
5253

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

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

7879
t.Log("One server down")
7980
servers[2].Servers[0].Stop()
80-
waitUntilGrpcServerIsDown(ctx, t, &servers[2].Configs[0].Endpoint)
81+
listener1 := holdPort(ctx, t, servers[2].Configs[0])
8182
submit(t, &conf, outputBlocks, expectedSubmit{
8283
success: 3,
8384
})
8485

8586
t.Log("Two servers down")
8687
servers[2].Servers[1].Stop()
87-
waitUntilGrpcServerIsDown(ctx, t, &servers[2].Configs[1].Endpoint)
88+
listener2 := holdPort(ctx, t, servers[2].Configs[1])
8889
submit(t, &conf, outputBlocks, expectedSubmit{
8990
success: 2,
9091
unavailable: 1,
9192
})
9293

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

101103
t.Log("All good again")
102104
fakeServer.Stop()
103-
waitUntilGrpcServerIsDown(ctx, t, &servers[2].Configs[0].Endpoint)
104105
servers[2].Servers[0] = test.RunGrpcServerForTest(ctx, t, servers[2].Configs[0], ordererService.RegisterService)
105106
waitUntilGrpcServerIsReady(ctx, t, &servers[2].Configs[0].Endpoint)
106107
submit(t, &conf, outputBlocks, expectedSubmit{
107108
success: 3,
108109
})
109110

110111
t.Log("Insufficient quorum")
112+
_ = listener2.Close()
111113
for _, gs := range servers[:2] {
112114
for _, s := range gs.Servers[:2] {
113115
s.Stop()
114116
}
115117
}
116118
for _, gs := range servers[:2] {
117119
for _, c := range gs.Configs[:2] {
118-
waitUntilGrpcServerIsDown(ctx, t, &c.Endpoint)
120+
holdPort(ctx, t, c)
119121
}
120122
}
121123
submit(t, &conf, outputBlocks, expectedSubmit{
@@ -231,11 +233,17 @@ func waitUntilGrpcServerIsReady(ctx context.Context, t *testing.T, endpoint *con
231233
t.Logf("%v is ready", endpoint)
232234
}
233235

234-
func waitUntilGrpcServerIsDown(ctx context.Context, t *testing.T, endpoint *connection.Endpoint) {
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 {
235242
t.Helper()
236-
newConn, err := connection.Connect(test.NewInsecureDialConfig(endpoint))
243+
listener, err := c.Listener(ctx)
237244
require.NoError(t, err)
238-
defer connection.CloseConnectionsLog(newConn)
239-
test.WaitUntilGrpcServerIsDown(ctx, t, newConn)
240-
t.Logf("%v is down", endpoint)
245+
t.Cleanup(func() {
246+
_ = listener.Close()
247+
})
248+
return listener
241249
}

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()
65+
l, err := serverConfig.Listener(ctx)
6666
if err != nil {
6767
return err
6868
}

utils/test/utils.go

Lines changed: 1 addition & 20 deletions
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()
83+
listener, err := serverConfig.Listener(ctx)
8484
require.NoError(tb, err)
8585
server, err := serverConfig.GrpcServer()
8686
require.NoError(tb, err)
@@ -221,25 +221,6 @@ 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-
243224
// StatusRetriever provides implementation retrieve status of given transaction identifiers.
244225
type StatusRetriever interface {
245226
GetTransactionsStatus(context.Context, *protoblocktx.QueryStatus, ...grpc.CallOption) (

0 commit comments

Comments
 (0)