forked from hyperledger-labs/mirbft
-
Notifications
You must be signed in to change notification settings - Fork 2
/
mirbft_suite_test.go
37 lines (29 loc) · 942 Bytes
/
mirbft_suite_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package mirbft_test
import (
"os"
"testing"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
// ContextTimeout is an unfortunate parameter included for executing
// the stress related tests. Most of the testing we try to make deterministic
// and independent of time (for instance, by specifying step counts), but for
// the more 'real' integration stress tests, this is not possible. Since
// the CI hardware is weak, and, the race detector slows testing considerably,
// this value is overridded via MIRBFT_TEST_CONTEXT_TIMEOUT in CI.
var ContextTimeout = 30 * time.Second
func TestMirbft(t *testing.T) {
RegisterFailHandler(Fail)
val := os.Getenv("MIRBFT_TEST_CONTEXT_TIMEOUT")
if val != "" {
dur, err := time.ParseDuration(val)
Expect(err).NotTo(HaveOccurred())
ContextTimeout = dur
}
RunSpecs(t, "Mirbft Suite")
}