Skip to content
This repository was archived by the owner on Nov 7, 2023. It is now read-only.

Commit d32cb4a

Browse files
author
Sergey Fedorov
committed
core: Terminate client and replica instances in integration test
Signed-off-by: Sergey Fedorov <sergey.fedorov@neclab.eu>
1 parent a524bd6 commit d32cb4a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

core/integration_test.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ type testClientStack struct {
5757
}
5858

5959
var (
60-
replicas []api.Replica
60+
replicas []minbft.Replica
6161
replicaStacks []*testReplicaStack
6262

6363
clients []cl.Client
@@ -142,6 +142,15 @@ func initTestnetPeers(numReplica int, numClient int) {
142142
makeClients(numClient, testKeys, cfg)
143143
}
144144

145+
func teardownTestnet() {
146+
for _, client := range clients {
147+
client.Terminate()
148+
}
149+
for _, replica := range replicas {
150+
replica.Terminate()
151+
}
152+
}
153+
145154
// Initialize a given number of replica instances.
146155
func makeReplicas(numReplica int, testKeys []byte, cfg api.Configer) {
147156
// replica stubs
@@ -207,6 +216,7 @@ func testAcceptOneRequest(t *testing.T) {
207216
for _, stack := range replicaStacks {
208217
assert.Equal(t, uint64(1), stack.SimpleLedger.GetLength())
209218
}
219+
210220
}
211221

212222
func TestIntegration(t *testing.T) {

0 commit comments

Comments
 (0)