Merge pull request #3214 from nats-io/go_1.18

Go 1.18
This commit is contained in:
Derek Collison
2022-06-24 11:22:45 -07:00
committed by GitHub
5 changed files with 21 additions and 10 deletions

View File

@@ -7,7 +7,7 @@ vm:
language: go
go:
- 1.17.x
- 1.18.x
addons:
apt:
@@ -32,10 +32,10 @@ jobs:
- name: "Run all tests from all other packages"
env: TEST_SUITE=non_srv_pkg_tests
- name: "Compile and various checks with older Go release"
go: 1.16.x
env: TEST_SUITE=compile
go: 1.17.x
env: TEST_SUITE=build_only
script: ./runTestsOnTravis.sh $TEST_SUITE
script: ./scripts/runTestsOnTravis.sh $TEST_SUITE
deploy:
provider: script
@@ -43,4 +43,4 @@ deploy:
script: curl -sL http://git.io/goreleaser | bash
on:
tags: true
condition: ($TRAVIS_GO_VERSION =~ 1.17) && ($TEST_SUITE = "compile")
condition: ($TRAVIS_GO_VERSION =~ 1.18) && ($TEST_SUITE = "compile")

View File

@@ -6,7 +6,7 @@ if [ "$1" = "compile" ]; then
# We will compile and run some vet, spelling and some other checks.
go install honnef.co/go/tools/cmd/staticcheck@v0.2.2;
go install honnef.co/go/tools/cmd/staticcheck@latest;
go install github.com/client9/misspell/cmd/misspell@latest;
GO_LIST=$(go list ./...);
go build;
@@ -15,14 +15,19 @@ if [ "$1" = "compile" ]; then
find . -type f -name "*.go" | xargs misspell -error -locale US;
staticcheck $GO_LIST
if [ "$TRAVIS_TAG" != "" ]; then
export GODEBUG="x509sha1=1"
go test -race -v -run=TestVersionMatchesTag ./server -count=1 -vet=off
fi
elif [ "$1" = "build_only" ]; then
go build;
elif [ "$1" = "no_race_tests" ]; then
# Run tests without the `-race` flag. By convention, those tests start
# with `TestNoRace`.
export GODEBUG="x509sha1=1"
go test -v -p=1 -run=TestNoRace ./... -count=1 -vet=off -timeout=30m -failfast
elif [ "$1" = "js_tests" ]; then
@@ -32,6 +37,7 @@ elif [ "$1" = "js_tests" ]; then
# tests by using the `skip_js_cluster_tests` and `skip_js_super_cluster_tests`
# build tags.
export GODEBUG="x509sha1=1"
go test -race -v -run=TestJetStream ./server -tags=skip_js_cluster_tests,skip_js_super_cluster_tests -count=1 -vet=off -timeout=30m -failfast
elif [ "$1" = "js_cluster_tests" ]; then
@@ -39,6 +45,7 @@ elif [ "$1" = "js_cluster_tests" ]; then
# Run JetStream clustered tests. By convention, all JS cluster tests
# start with `TestJetStreamCluster`.
export GODEBUG="x509sha1=1"
go test -race -v -run=TestJetStreamCluster ./server -count=1 -vet=off -timeout=30m -failfast
elif [ "$1" = "js_super_cluster_tests" ]; then
@@ -46,6 +53,7 @@ elif [ "$1" = "js_super_cluster_tests" ]; then
# Run JetStream super clustered tests. By convention, all JS super cluster
# tests with `TestJetStreamSuperCluster`.
export GODEBUG="x509sha1=1"
go test -race -v -run=TestJetStreamSuperCluster ./server -count=1 -vet=off -timeout=30m -failfast
elif [ "$1" = "srv_pkg_non_js_tests" ]; then
@@ -53,12 +61,14 @@ elif [ "$1" = "srv_pkg_non_js_tests" ]; then
# Run all non JetStream tests in the server package. We exclude the
# JS tests by using the `skip_js_tests` build tag.
export GODEBUG="x509sha1=1"
go test -race -v -p=1 ./server/... -tags=skip_js_tests -count=1 -vet=off -timeout=30m -failfast
elif [ "$1" = "non_srv_pkg_tests" ]; then
# Run all tests of all non server package.
export GODEBUG="x509sha1=1"
go test -race -v -p=1 $(go list ./... | grep -v "/server") -count=1 -vet=off -timeout=30m -failfast
fi

View File

@@ -2610,7 +2610,7 @@ func TestLeafNodeTLSConfigReload(t *testing.T) {
// Wait for the error
select {
case err := <-lg.errCh:
if !strings.Contains(err, "unknown") {
if !strings.Contains(err, "unknown") && !strings.Contains(err, "broken") {
t.Fatalf("Unexpected error: %v", err)
}
case <-time.After(2 * time.Second):

View File

@@ -3529,6 +3529,7 @@ func (s *Server) acceptError(acceptName string, err error, tmpDelay time.Duratio
if !s.isRunning() {
return -1
}
//lint:ignore SA1019 We want to retry on a bunch of errors here.
if ne, ok := err.(net.Error); ok && ne.Temporary() {
s.Errorf("Temporary %s Accept Error(%v), sleeping %dms", acceptName, ne, tmpDelay/time.Millisecond)
select {

View File

@@ -372,11 +372,11 @@ const (
func (st StorageType) String() string {
switch st {
case MemoryStorage:
return strings.Title(memoryStorageString)
return "Memory"
case FileStorage:
return strings.Title(fileStorageString)
return "File"
case AnyStorage:
return strings.Title(anyStorageString)
return "Any"
default:
return "Unknown Storage Type"
}