@@ -170,6 +170,7 @@ func TestCache(t *testing.T) {
170
170
t .Fatal (err )
171
171
}
172
172
ps := newTestPss (privkey , nil , nil )
173
+ defer ps .Stop ()
173
174
pp := NewPssParams ().WithPrivateKey (privkey )
174
175
data := []byte ("foo" )
175
176
datatwo := []byte ("bar" )
@@ -648,6 +649,7 @@ func TestMessageProcessing(t *testing.T) {
648
649
addr := make ([]byte , 32 )
649
650
addr [0 ] = 0x01
650
651
ps := newTestPss (privkey , network .NewKademlia (addr , network .NewKadParams ()), NewPssParams ())
652
+ defer ps .Stop ()
651
653
652
654
// message should pass
653
655
msg := newPssMsg (& msgParams {})
@@ -780,6 +782,7 @@ func TestKeys(t *testing.T) {
780
782
t .Fatalf ("failed to retrieve 'their' private key" )
781
783
}
782
784
ps := newTestPss (ourprivkey , nil , nil )
785
+ defer ps .Stop ()
783
786
784
787
// set up peer with mock address, mapped to mocked publicaddress and with mocked symkey
785
788
addr := make (PssAddress , 32 )
@@ -829,6 +832,7 @@ func TestGetPublickeyEntries(t *testing.T) {
829
832
t .Fatal (err )
830
833
}
831
834
ps := newTestPss (privkey , nil , nil )
835
+ defer ps .Stop ()
832
836
833
837
peeraddr := network .RandomAddr ().Over ()
834
838
topicaddr := make (map [Topic ]PssAddress )
@@ -932,6 +936,7 @@ func TestPeerCapabilityMismatch(t *testing.T) {
932
936
Payload : & whisper.Envelope {},
933
937
}
934
938
ps := newTestPss (privkey , kad , nil )
939
+ defer ps .Stop ()
935
940
936
941
// run the forward
937
942
// it is enough that it completes; trying to send to incapable peers would create segfault
@@ -950,6 +955,7 @@ func TestRawAllow(t *testing.T) {
950
955
baseAddr := network .RandomAddr ()
951
956
kad := network .NewKademlia ((baseAddr ).Over (), network .NewKadParams ())
952
957
ps := newTestPss (privKey , kad , nil )
958
+ defer ps .Stop ()
953
959
topic := BytesToTopic ([]byte {0x2a })
954
960
955
961
// create handler innards that increments every time a message hits it
@@ -1691,6 +1697,7 @@ func benchmarkSymKeySend(b *testing.B) {
1691
1697
keys , err := wapi .NewKeyPair (ctx )
1692
1698
privkey , err := w .GetPrivateKey (keys )
1693
1699
ps := newTestPss (privkey , nil , nil )
1700
+ defer ps .Stop ()
1694
1701
msg := make ([]byte , msgsize )
1695
1702
rand .Read (msg )
1696
1703
topic := BytesToTopic ([]byte ("foo" ))
@@ -1735,6 +1742,7 @@ func benchmarkAsymKeySend(b *testing.B) {
1735
1742
keys , err := wapi .NewKeyPair (ctx )
1736
1743
privkey , err := w .GetPrivateKey (keys )
1737
1744
ps := newTestPss (privkey , nil , nil )
1745
+ defer ps .Stop ()
1738
1746
msg := make ([]byte , msgsize )
1739
1747
rand .Read (msg )
1740
1748
topic := BytesToTopic ([]byte ("foo" ))
@@ -1785,6 +1793,7 @@ func benchmarkSymkeyBruteforceChangeaddr(b *testing.B) {
1785
1793
} else {
1786
1794
ps = newTestPss (privkey , nil , nil )
1787
1795
}
1796
+ defer ps .Stop ()
1788
1797
topic := BytesToTopic ([]byte ("foo" ))
1789
1798
for i := 0 ; i < int (keycount ); i ++ {
1790
1799
to := make (PssAddress , 32 )
@@ -1868,6 +1877,7 @@ func benchmarkSymkeyBruteforceSameaddr(b *testing.B) {
1868
1877
} else {
1869
1878
ps = newTestPss (privkey , nil , nil )
1870
1879
}
1880
+ defer ps .Stop ()
1871
1881
topic := BytesToTopic ([]byte ("foo" ))
1872
1882
for i := 0 ; i < int (keycount ); i ++ {
1873
1883
copy (addr [i ], network .RandomAddr ().Over ())
0 commit comments