Skip to content

Commit 68da919

Browse files
author
enikon
committed
OAS-10877 Updated go to 1.23 (#454)
1 parent 29a1f46 commit 68da919

File tree

7 files changed

+39
-29
lines changed

7 files changed

+39
-29
lines changed

.circleci/config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2.1
33
parameters:
44
goImage:
55
type: string
6-
default: "gcr.io/gcr-for-testing/golang:1.22.12"
6+
default: "gcr.io/gcr-for-testing/golang:1.23.8"
77
arangodbImage:
88
type: string
99
default: "gcr.io/gcr-for-testing/arangodb/enterprise:3.11"
@@ -17,7 +17,7 @@ parameters:
1717
executors:
1818
golang-executor:
1919
docker:
20-
- image: gcr.io/gcr-for-testing/golang:1.22.12
20+
- image: gcr.io/gcr-for-testing/golang:1.23.8
2121
machine-executor:
2222
machine:
2323
image: ubuntu-2204:current

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ REPOPATH := $(ORGPATH)/$(REPONAME)
4040
ALPINE_IMAGE ?= alpine:3.21
4141

4242
GOPATH := $(GOBUILDDIR)
43-
GOVERSION := 1.22.12
43+
GOVERSION := 1.23.8
4444
GOIMAGE ?= golang:$(GOVERSION)-alpine3.21
4545

4646
GOOS ?= linux
@@ -255,13 +255,13 @@ tools:
255255
@echo ">> Fetching gci"
256256
@GOBIN=$(GOPATH)/bin go install github.com/daixiang0/[email protected]
257257
@echo ">> Fetching goimports"
258-
@GOBIN=$(GOPATH)/bin go install golang.org/x/tools/cmd/goimports@0bb7e5c47b1a31f85d4f173edc878a8e049764a5
258+
@GOBIN=$(GOPATH)/bin go install golang.org/x/tools/cmd/goimports@v0.32.0
259259
@echo ">> Fetching license check"
260260
@GOBIN=$(GOPATH)/bin go install github.com/google/addlicense@6d92264d717064f28b32464f0f9693a5b4ef0239
261261
@echo ">> Fetching github release"
262262
@GOBIN=$(GOPATH)/bin go install github.com/aktau/[email protected]
263263
@echo ">> Fetching govulncheck"
264-
@GOBIN=$(GOPATH)/bin go install golang.org/x/vuln/cmd/govulncheck@v1.0.4
264+
@GOBIN=$(GOPATH)/bin go install golang.org/x/vuln/cmd/govulncheck@v1.1.3
265265
@echo ">> Fetching goversioninfo"
266266
@GOBIN=$(GOPATH)/bin go install github.com/josephspurrier/goversioninfo/cmd/[email protected]
267267

go.mod

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/arangodb-helper/arangodb
22

3-
go 1.22.0
4-
5-
toolchain go1.22.12
3+
go 1.23.8
64

75
require (
86
github.com/arangodb-helper/go-certificates v0.0.0-20180821055445-9fca24fc2680
@@ -24,7 +22,7 @@ require (
2422
github.com/spf13/cobra v1.0.0
2523
github.com/spf13/pflag v1.0.5
2624
github.com/stretchr/testify v1.9.0
27-
golang.org/x/crypto v0.31.0
25+
golang.org/x/crypto v0.35.0
2826
gopkg.in/ini.v1 v1.66.6
2927
)
3028

@@ -61,8 +59,8 @@ require (
6159
github.com/pavel-v-chernykh/keystore-go v2.1.0+incompatible // indirect
6260
github.com/pmezard/go-difflib v1.0.0 // indirect
6361
github.com/sirupsen/logrus v1.9.3 // indirect
64-
golang.org/x/sys v0.28.0 // indirect
65-
golang.org/x/term v0.27.0 // indirect
62+
golang.org/x/sys v0.31.0 // indirect
63+
golang.org/x/term v0.30.0 // indirect
6664
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
6765
gopkg.in/yaml.v3 v3.0.1 // indirect
6866
gotest.tools/v3 v3.4.0 // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -212,8 +212,8 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf
212212
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
213213
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
214214
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
215-
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
216-
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
215+
golang.org/x/crypto v0.35.0 h1:b15kiHdrGCHrP6LvwaQ3c03kgNhhiMgvlhxHQhmg2Xs=
216+
golang.org/x/crypto v0.35.0/go.mod h1:dy7dXNW32cAb/6/PRuTNsix8T+vJAqvuIy5Bli/x0YQ=
217217
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
218218
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
219219
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
@@ -249,10 +249,10 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
249249
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
250250
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
251251
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
252-
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
253-
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
254-
golang.org/x/term v0.27.0 h1:WP60Sv1nlK1T6SupCHbXzSaN0b9wUmsPoRS9b61A23Q=
255-
golang.org/x/term v0.27.0/go.mod h1:iMsnZpn0cago0GOrHO2+Y7u7JPn5AylBrcoWkElMTSM=
252+
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik=
253+
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
254+
golang.org/x/term v0.30.0 h1:PQ39fJZ+mfadBm0y5WlL4vlM7Sx1Hgf13sMIY2+QS9Y=
255+
golang.org/x/term v0.30.0/go.mod h1:NYYFdzHoI5wRh/h5tDMdMqCqPJZEuNqVR5xJLd/n67g=
256256
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
257257
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
258258
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=

test/process_cluster_recovery_test.go

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,25 @@ import (
3838
func TestProcessClusterRecovery(t *testing.T) {
3939
removeArangodProcesses(t)
4040
testMatch(t, testModeProcess, starterModeCluster, false)
41-
dataDirMaster := SetUniqueDataDir(t)
42-
defer os.RemoveAll(dataDirMaster)
4341

4442
start := time.Now()
4543

44+
dataDirMaster := SetUniqueDataDir(t)
45+
defer os.RemoveAll(dataDirMaster)
4646
master := Spawn(t, "${STARTER} --starter.port=8528 "+createEnvironmentStarterOptions())
47+
master.label = "Master"
4748
defer closeProcess(t, master, "Master")
4849

4950
dataDirSlave1 := SetUniqueDataDir(t)
5051
defer os.RemoveAll(dataDirSlave1)
5152
slave1 := Spawn(t, "${STARTER} --starter.port=8628 --starter.join 127.0.0.1:8528 "+createEnvironmentStarterOptions())
53+
slave1.label = "Slave1"
5254
defer closeProcess(t, slave1, "Slave1")
5355

5456
dataDirSlave2 := SetUniqueDataDir(t)
5557
defer os.RemoveAll(dataDirSlave2)
5658
slave2 := Spawn(t, "${STARTER} --starter.port=8728 --starter.join 127.0.0.1:8528 "+createEnvironmentStarterOptions())
59+
slave2.label = "Slave2"
5760
defer closeProcess(t, slave2, "Slave2")
5861

5962
if ok := WaitUntilStarterReady(t, whatCluster, 3, master, slave1, slave2); ok {
@@ -102,20 +105,21 @@ func TestProcessClusterRecovery(t *testing.T) {
102105
t.Errorf("Failed to create RECOVERY file: %s", describe(err))
103106
}
104107

105-
// Restart slave1
108+
// Restart slave1 (recovery)
106109
os.Setenv("DATA_DIR", dataDirSlave1)
107-
master = Spawn(t, "${STARTER} --starter.port=8628 --starter.join 127.0.0.1:8528 "+createEnvironmentStarterOptions())
108-
defer closeProcess(t, master, "Master 2")
110+
slave1Recovery := Spawn(t, "${STARTER} --starter.port=8628 --starter.join 127.0.0.1:8528 "+createEnvironmentStarterOptions())
111+
slave1Recovery.label = "Slave1 Recovery"
112+
defer closeProcess(t, slave1Recovery, "Slave 1 Recovery")
109113

110114
// Wait until recovered
111-
if ok := WaitUntilStarterReady(t, whatCluster, 3, master, slave1, slave2); ok {
115+
if ok := WaitUntilStarterReady(t, whatCluster, 3, master, slave1Recovery, slave2); ok {
112116
t.Logf("Cluster start (with recovery) took %s", time.Since(start))
113117
testCluster(t, insecureStarterEndpoint(0), false)
114118
testCluster(t, insecureStarterEndpoint(100), false)
115119
testCluster(t, insecureStarterEndpoint(200), false)
116120
}
117121

118-
// RECOVERY file must now be gone within 30s:
122+
// The RECOVERY file must now be gone within the 30s:
119123
startWait := time.Now()
120124
for {
121125
if _, err := os.Stat(filepath.Join(dataDirSlave1, "RECOVERY")); os.IsNotExist(err) {
@@ -131,5 +135,6 @@ func TestProcessClusterRecovery(t *testing.T) {
131135
if isVerbose {
132136
t.Log("Waiting for termination")
133137
}
134-
SendIntrAndWait(t, master, slave1, slave2)
138+
139+
SendIntrAndWait(t, master, slave1Recovery, slave2)
135140
}

test/process_util.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,16 @@ import (
3232
)
3333

3434
func removeArangodProcesses(t *testing.T) {
35-
c := SpawnWithExpand(t, "sh -c 'PIDS=$(pidof -x arangod); if [ ! -z \"${PIDS}\" ]; then kill -9 ${PIDS}; fi'", false)
35+
t.Log("Removing arangod processes")
36+
listArangodProcesses(t, GetLogger(t))
37+
c := SpawnWithExpand(t, "sh -c 'PIDS=$(pidof arangod); if [ ! -z \"${PIDS}\" ]; then kill -9 ${PIDS}; fi'", false)
3638
defer c.Close()
37-
c.Wait()
39+
err := c.Wait()
40+
if err != nil {
41+
t.Errorf("Failed to kill arangod processes: %v", err)
42+
} else {
43+
t.Log("Successfully killed arangod processes")
44+
}
3845
}
3946

4047
func closeProcess(t *testing.T, s *SubProcess, name string) {
@@ -44,7 +51,7 @@ func closeProcess(t *testing.T, s *SubProcess, name string) {
4451
}
4552

4653
func listArangodProcesses(t *testing.T, log Logger) {
47-
c := SpawnWithExpand(t, "pidof -x arangod", false)
54+
c := SpawnWithExpand(t, "pidof arangod", false)
4855
defer c.Close()
4956
c.Wait()
5057

test/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ func logProcessOutput(log Logger, p *SubProcess, prefix string, args ...interfac
536536
for {
537537
line, _, err := reader.ReadLine()
538538
if len(line) > 0 {
539-
if pre != "" {
539+
if pre == "" {
540540
log.Log(string(line))
541541
} else {
542542
log.Log("%s%s", pre, string(line))

0 commit comments

Comments
 (0)