Skip to content

Commit b619b94

Browse files
authored
Merge pull request #2949 from Algo-devops-service/relstable3.0.1
go-algorand 3.0.1-stable
2 parents c1d2eb7 + d279007 commit b619b94

File tree

328 files changed

+35967
-100580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

328 files changed

+35967
-100580
lines changed

.circleci/config.yml

Lines changed: 227 additions & 26 deletions
Large diffs are not rendered by default.

.golangci-warnings.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
run:
22
timeout: 5m
33
tests: true
4-
4+
55
linters:
66
disable-all: true
77
enable:
@@ -74,3 +74,6 @@ issues:
7474
- gosimple
7575
- unused
7676
- partitiontest
77+
- path: crypto/secp256k1/secp256_test\.go
78+
linters:
79+
- partitiontest

.travis.yml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ jobs:
3131
- scripts/travis/build_test.sh
3232

3333
- stage: build_pr
34-
os: linux
35-
name: Ubuntu AMD64 CodeGen Verification
36-
script:
37-
- scripts/travis/codegen_verification.sh
38-
- # same stage, parallel job
3934
os: linux
4035
name: Ubuntu AMD64 Build
4136
script:
@@ -92,11 +87,6 @@ jobs:
9287
- $mingw64 scripts/travis/build_test.sh
9388

9489
- stage: build_release
95-
os: linux
96-
name: Ubuntu AMD64 CodeGen Verification
97-
script:
98-
- scripts/travis/codegen_verification.sh
99-
- # same stage, parallel job
10090
os: linux
10191
name: Ubuntu AMD64 Build
10292
script:
@@ -217,9 +207,6 @@ before_cache:
217207
esac
218208
docker save -o $HOME/docker_cache/images.tar $(docker images -a -q)
219209
220-
#after_success:
221-
# - scripts/travis/upload_coverage.sh || true
222-
223210
addons:
224211
apt:
225212
packages:

agreement/agreementtest/simulate_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import (
3737
"github.com/algorand/go-algorand/data/committee"
3838
"github.com/algorand/go-algorand/logging"
3939
"github.com/algorand/go-algorand/protocol"
40+
"github.com/algorand/go-algorand/test/partitiontest"
4041
"github.com/algorand/go-algorand/util/db"
4142
)
4243

@@ -294,6 +295,8 @@ func (l *testLedger) EnsureDigest(c agreement.Certificate, verifier *agreement.A
294295
}
295296

296297
func TestSimulate(t *testing.T) {
298+
partitiontest.PartitionTest(t)
299+
297300
f, _ := os.Create(t.Name() + ".log")
298301
logging.Base().SetJSONFormatter()
299302
logging.Base().SetOutput(f)

agreement/fuzzer/tests_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"math"
2626
"math/rand"
2727
"os"
28+
2829
//ossignal "os/signal"
2930
"path/filepath"
3031
//"runtime/pprof"
@@ -36,6 +37,7 @@ import (
3637

3738
"github.com/algorand/go-algorand/logging"
3839
"github.com/algorand/go-deadlock"
40+
3941
//"github.com/algorand/go-algorand/protocol"
4042
"github.com/algorand/go-algorand/test/partitiontest"
4143
)
@@ -105,6 +107,8 @@ func testConfig(t *testing.T, config NetworkConfig) (network *Network) {
105107
*/
106108

107109
func TestCircularNetworkTopology(t *testing.T) {
110+
// partitiontest.PartitionTest(t)
111+
// Causes double partition, so commented out on purpose
108112
var nodeCounts []int
109113
if testing.Short() {
110114
nodeCounts = []int{4, 6}
@@ -422,6 +426,8 @@ type FuzzerTestFile struct {
422426
}
423427

424428
func TestFuzzer(t *testing.T) {
429+
// partitiontest.PartitionTest(t)
430+
// Causes double partition, so commented out on purpose
425431
jsonFiles := make(map[string]string) // map json test to full json file name.
426432
err := filepath.Walk(".", func(path string, info os.FileInfo, err error) error {
427433
if strings.HasSuffix(info.Name(), ".json") {
@@ -475,6 +481,8 @@ func TestFuzzer(t *testing.T) {
475481
}
476482

477483
func TestNetworkBandwidth(t *testing.T) {
484+
// partitiontest.PartitionTest(t)
485+
// Causes double partition, so commented out on purpose
478486
// travis rans out of memory when we get a high nodes count.. so we'll skip it for now.
479487
if testing.Short() {
480488
t.Skip()

cmd/algofix/deadlock_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"strings"
2626
"testing"
2727

28+
"github.com/algorand/go-algorand/test/partitiontest"
2829
"github.com/stretchr/testify/require"
2930
)
3031

@@ -130,6 +131,7 @@ func main() {
130131
`
131132

132133
func TestDeadlockRewrite(t *testing.T) {
134+
partitiontest.PartitionTest(t)
133135
t.Run("simple", func(t *testing.T) { testDeadlock(t, deadlockSimpleSrc, deadlockSimpleDest) })
134136
t.Run("onoff", func(t *testing.T) { testDeadlock(t, deadlockTestSrc, deadlockTestFin) })
135137
}

cmd/algofix/main_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import (
99
"go/parser"
1010
"strings"
1111
"testing"
12+
13+
"github.com/algorand/go-algorand/test/partitiontest"
1214
)
1315

1416
type testCase struct {
@@ -73,6 +75,7 @@ func parseFixPrint(t *testing.T, fn func(*ast.File) bool, desc, in string, mustB
7375
}
7476

7577
func TestRewrite(t *testing.T) {
78+
partitiontest.PartitionTest(t)
7679
for _, tt := range testCases {
7780
// Apply fix: should get tt.Out.
7881
out, fixed, ok := parseFixPrint(t, tt.Fn, tt.Name, tt.In, true)

cmd/algoh/blockWatcher_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import (
2323
"time"
2424

2525
"github.com/algorand/go-algorand/daemon/algod/api/spec/v1"
26+
"github.com/algorand/go-algorand/test/partitiontest"
2627
"github.com/stretchr/testify/require"
2728
)
2829

@@ -38,6 +39,7 @@ func bw(client Client) *blockWatcher {
3839
// When the status continues to report block 300
3940
// Then blockIfStalled will block until the next block is reported
4041
func TestBlockIfStalled(t *testing.T) {
42+
partitiontest.PartitionTest(t)
4143
client := mockClient{
4244
error: []error{nil, nil, nil},
4345
status: makeNodeStatuses(300, 300, 300, 301),
@@ -59,6 +61,7 @@ func TestBlockIfStalled(t *testing.T) {
5961
// When the status continues to increase quickly
6062
// Then blockIfCatchup will block until a block is reported twice
6163
func TestBlockIfCatchup(t *testing.T) {
64+
partitiontest.PartitionTest(t)
6265
client := mockClient{
6366
error: []error{nil, nil, nil},
6467
status: makeNodeStatuses(301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 310),
@@ -80,6 +83,7 @@ func TestBlockIfCatchup(t *testing.T) {
8083
// When the status is not changing quickly
8184
// Then blockIfCatchup will return after the first status call.
8285
func TestBlockIfCaughtUp(t *testing.T) {
86+
partitiontest.PartitionTest(t)
8387
client := mockClient{
8488
error: []error{nil, nil, nil},
8589
status: makeNodeStatuses(300),
@@ -111,6 +115,7 @@ func (l *testlistener) onBlock(block v1.Block) {
111115
}
112116

113117
func TestE2E(t *testing.T) {
118+
partitiontest.PartitionTest(t)
114119
client := makeMockClient(
115120
[]error{nil, nil, nil},
116121
makeNodeStatuses(300, 301, 302, 302, 302, 302, 302, 302, 310, 320, 321, 321, 321, 322),
@@ -159,6 +164,7 @@ func TestE2E(t *testing.T) {
159164
}
160165

161166
func TestAbortDuringStall(t *testing.T) {
167+
partitiontest.PartitionTest(t)
162168
client := makeMockClient(
163169
[]error{},
164170
makeNodeStatuses(300),

cmd/algoh/blockstats_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222

2323
"github.com/algorand/go-algorand/daemon/algod/api/spec/v1"
2424
"github.com/algorand/go-algorand/logging/telemetryspec"
25+
"github.com/algorand/go-algorand/test/partitiontest"
2526
"github.com/stretchr/testify/require"
2627
)
2728

@@ -42,6 +43,7 @@ func (mes *MockEventSender) EventWithDetails(category telemetryspec.Category, id
4243
}
4344

4445
func TestConsecutiveBlocks(t *testing.T) {
46+
partitiontest.PartitionTest(t)
4547
sender := MockEventSender{}
4648
bs := blockstats{log: &sender}
4749

@@ -57,6 +59,7 @@ func TestConsecutiveBlocks(t *testing.T) {
5759
}
5860

5961
func TestAgreementTime(t *testing.T) {
62+
partitiontest.PartitionTest(t)
6063
sleepTime := 50 * time.Millisecond
6164
testAttempts := 0
6265
const maxTestAttempts = 10

cmd/algoh/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ func main() {
165165
}()
166166

167167
// Handle signals cleanly
168-
c := make(chan os.Signal)
168+
c := make(chan os.Signal, 1)
169169
signal.Notify(c, os.Interrupt, syscall.SIGTERM, syscall.SIGINT)
170170
signal.Ignore(syscall.SIGHUP)
171171
go func() {

0 commit comments

Comments
 (0)