@@ -37,6 +37,7 @@ type testEnv struct {
37
37
m * manifest.Manifest
38
38
t * testing.T
39
39
testCtx context.Context
40
+ debug bool
40
41
}
41
42
42
43
// Test that checks that F3 is enabled successfully,
@@ -100,7 +101,6 @@ func TestF3_PauseAndRebootstrap(t *testing.T) {
100
101
e .ms .UpdateManifest (& cpy )
101
102
102
103
e .waitTillManifestChange (& cpy , 20 * time .Second )
103
- e .waitTillF3Instance (0 , 200 * time .Second )
104
104
e .waitTillF3Rebootstrap (20 * time .Second )
105
105
}
106
106
@@ -196,23 +196,26 @@ func (e *testEnv) waitFor(f func(n *kit.TestFullNode) bool, timeout time.Duratio
196
196
e .t .Helper ()
197
197
require .Eventually (e .t , func () bool {
198
198
e .t .Helper ()
199
- for _ , n := range e . minerFullNodes {
200
- if ! f ( n ) {
199
+ defer func () {
200
+ if e . debug {
201
201
var wg sync.WaitGroup
202
- printProgress := func (n * kit.TestFullNode ) {
202
+ printProgress := func (index int , n * kit.TestFullNode ) {
203
203
defer wg .Done ()
204
- id , err := n .ID (e .testCtx )
205
- require .NoError (e .t , err )
206
-
207
- progress , err := n .F3GetProgress (e .testCtx )
208
- require .NoError (e .t , err )
209
- e .t .Logf ("###### %s -> %v" , id , progress )
204
+ if progress , err := n .F3GetProgress (e .testCtx ); err != nil {
205
+ e .t .Logf ("Node #%d progress: err: %v" , index , err )
206
+ } else {
207
+ e .t .Logf ("Node #%d progress: %v" , index , progress )
208
+ }
210
209
}
211
- for _ , n := range e .minerFullNodes {
210
+ for i , n := range e .minerFullNodes {
212
211
wg .Add (1 )
213
- go printProgress (n )
212
+ go printProgress (i , n )
214
213
}
215
214
wg .Wait ()
215
+ }
216
+ }()
217
+ for _ , n := range e .minerFullNodes {
218
+ if ! f (n ) {
216
219
return false
217
220
}
218
221
}
@@ -227,13 +230,6 @@ func (e *testEnv) waitFor(f func(n *kit.TestFullNode) bool, timeout time.Duratio
227
230
// a miner. The last return value is the manifest sender for the network.
228
231
func setup (t * testing.T , blocktime time.Duration ) * testEnv {
229
232
manif := lf3 .NewManifest (BaseNetworkName + "/1" , DefaultFinality , DefaultBootstrapEpoch , blocktime , cid .Undef )
230
- manif .Gpbft .Delta = 250 * time .Millisecond
231
- manif .Gpbft .DeltaBackOffExponent = 1.3
232
- manif .Gpbft .RebroadcastBackoffBase = manif .Gpbft .Delta * 2
233
- manif .Gpbft .RebroadcastBackoffMax = manif .Gpbft .RebroadcastBackoffBase * 2
234
- manif .Gpbft .RebroadcastBackoffExponent = manif .Gpbft .DeltaBackOffExponent
235
- manif .Gpbft .RebroadcastBackoffSpread = 0.2
236
-
237
233
return setupWithStaticManifest (t , manif , false )
238
234
}
239
235
@@ -300,18 +296,6 @@ func setupWithStaticManifest(t *testing.T, manif *manifest.Manifest, testBootstr
300
296
require .NoError (t , err )
301
297
}
302
298
303
- m .CertificateExchange .MinimumPollInterval = 200 * time .Millisecond
304
- m .CertificateExchange .MaximumPollInterval = 1 * time .Second
305
- m .Gpbft .Delta = 250 * time .Millisecond
306
- m .Gpbft .DeltaBackOffExponent = 1.3
307
- m .Gpbft .RebroadcastBackoffBase = m .Gpbft .Delta * 2
308
- m .Gpbft .RebroadcastBackoffMax = m .Gpbft .RebroadcastBackoffBase * 2
309
- m .Gpbft .RebroadcastBackoffExponent = m .Gpbft .DeltaBackOffExponent
310
- m .Gpbft .RebroadcastBackoffSpread = 0.2
311
-
312
- e .ms .UpdateManifest (m )
313
- e .waitTillManifestChange (m , 30 * time .Second )
314
-
315
299
errgrp .Go (func () error {
316
300
defer func () {
317
301
require .NoError (t , manifestServerHost .Close ())
0 commit comments