Skip to content

Commit 58ba0d3

Browse files
authored
Merge pull request #229 from arangodb-helper/bug-fix/superfluous-err-msg
removed superfluous error message
2 parents 9d959fc + ab4de29 commit 58ba0d3

10 files changed

+24
-19
lines changed

.travis.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ go:
99
- "1.12.x"
1010

1111
env:
12-
- TEST_SUITE=run-tests-local-process ARANGODB=arangodb:3.3 STARTER_MODES="single,cluster,activefailover"
13-
- TEST_SUITE=run-tests-docker ARANGODB=arangodb:3.3 STARTER_MODES="single,cluster,activefailover"
14-
- TEST_SUITE=run-tests-local-process ARANGODB=arangodb/arangodb:latest STARTER_MODES="single,cluster,activefailover"
15-
- TEST_SUITE=run-tests-docker ARANGODB=arangodb/arangodb:latest STARTER_MODES="single,cluster,activefailover"
16-
- TEST_SUITE=run-tests-local-process ARANGODB=arangodb/arangodb-preview:latest STARTER_MODES="single,cluster,activefailover"
17-
- TEST_SUITE=run-tests-docker ARANGODB=arangodb/arangodb-preview:latest STARTER_MODES="single,cluster,activefailover"
12+
- VERBOSE=1 TEST_SUITE=run-tests-local-process ARANGODB=arangodb:3.3 STARTER_MODES="single,cluster,activefailover"
13+
- VERBOSE=1 TEST_SUITE=run-tests-docker ARANGODB=arangodb:3.3 STARTER_MODES="single,cluster,activefailover"
14+
- VERBOSE=1 TEST_SUITE=run-tests-local-process ARANGODB=arangodb/arangodb:latest STARTER_MODES="single,cluster,activefailover"
15+
- VERBOSE=1 TEST_SUITE=run-tests-docker ARANGODB=arangodb/arangodb:latest STARTER_MODES="single,cluster,activefailover"
16+
- VERBOSE=1 TEST_SUITE=run-tests-local-process ARANGODB=arangodb/arangodb-preview:latest STARTER_MODES="single,cluster,activefailover"
17+
- VERBOSE=1 TEST_SUITE=run-tests-docker ARANGODB=arangodb/arangodb-preview:latest STARTER_MODES="single,cluster,activefailover"
1818

1919
script: make $TEST_SUITE
2020

@@ -23,4 +23,4 @@ before_install:
2323
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
2424
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
2525
- sudo apt-get update
26-
- sudo apt-get -y install docker-ce
26+
- sudo apt-get -y install docker-ce

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ run-tests-local-process: build test-images
202202
-e STARTER=/usr/code/bin/linux/amd64/arangodb \
203203
-e TEST_MODES=localprocess \
204204
-e STARTER_MODES=$(STARTER_MODES) \
205+
-e VERBOSE=$(VERBOSE) \
205206
-e ENTERPRISE=$(ENTERPRISE) \
206207
-e TESTOPTIONS=$(TESTOPTIONS) \
207208
-e DEBUG_CLUSTER=$(DEBUG_CLUSTER) \

service/runner.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func terminateProcess(log zerolog.Logger, p Process, name string, killTimeout ti
8888
if err := p.Terminate(); err != nil {
8989
log.Warn().Err(err).Msgf("Failed to terminate %s", name)
9090
}
91-
p.Wait()
91+
p.Wait()
9292
log.Debug().Msgf("%s terminated", name)
9393
}()
9494
select {
@@ -98,5 +98,6 @@ func terminateProcess(log zerolog.Logger, p Process, name string, killTimeout ti
9898
// Kill the process
9999
log.Warn().Msgf("Killing %s...", name)
100100
p.Kill()
101+
p.Wait()
101102
}
102103
}

service/runner_process.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ func (p *process) Wait() {
156156
if p.isChild {
157157
ps, err := proc.Wait()
158158
if err != nil {
159-
p.log.Error().Err(err).Msgf("Wait on %d failed", proc.Pid)
159+
if err.Error() != "wait: no child processes" {
160+
// on terminate Wait might be called twice
161+
p.log.Error().Err(err).Msgf("Wait on %d failed", proc.Pid)
162+
}
160163
} else if ps.ExitCode() != 0 {
161164
if ws, ok := ps.Sys().(syscall.WaitStatus); ok {
162165
l := p.log.Info()

test/docker_install_go.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if [ ! -z "$(which apt-get)" ]; then
2929
esac; \
3030
\
3131
url="https://golang.org/dl/go${GOLANG_VERSION}.${goRelArch}.tar.gz"; \
32-
wget -O go.tgz "$url"; \
32+
wget -q -O go.tgz "$url"; \
3333
sha256sum *go.tgz ; \
3434
echo "${goRelSha256} *go.tgz" | sha256sum -c -; \
3535
tar -C /usr/local -xzf go.tgz; \
@@ -73,7 +73,7 @@ else
7373
x86) export GO386='387' ;; \
7474
esac; \
7575
\
76-
wget -O go.tgz "https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz"; \
76+
wget -q -O go.tgz "https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz"; \
7777
sha256sum *go.tgz ; \
7878
echo '4affc3e610cd8182c47abbc5b0c0e4e3c6a2b945b55aaa2ba952964ad9df1467 *go.tgz' | sha256sum -c -; \
7979
tar -C /usr/local -xzf go.tgz; \

test/process_cluster_local_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func TestProcessClusterLocal(t *testing.T) {
4141
child := Spawn(t, "${STARTER} --starter.local "+createEnvironmentStarterOptions())
4242
defer child.Close()
4343

44-
if ok := WaitUntilStarterReady(t, whatCluster, 1, child); ok {
44+
if ok := WaitUntilStarterReady(t, whatCluster, 3, child); ok {
4545
t.Logf("Cluster start took %s", time.Since(start))
4646
testCluster(t, insecureStarterEndpoint(0*portIncrement), false)
4747
testCluster(t, insecureStarterEndpoint(1*portIncrement), false)
@@ -67,7 +67,7 @@ func TestProcessClusterLocalShutdownViaAPI(t *testing.T) {
6767
child := Spawn(t, "${STARTER} --starter.local "+createEnvironmentStarterOptions())
6868
defer child.Close()
6969

70-
if ok := WaitUntilStarterReady(t, whatCluster, 1, child); ok {
70+
if ok := WaitUntilStarterReady(t, whatCluster, 3, child); ok {
7171
t.Logf("Cluster start took %s", time.Since(start))
7272
testCluster(t, insecureStarterEndpoint(0*portIncrement), false)
7373
testCluster(t, insecureStarterEndpoint(1*portIncrement), false)
@@ -93,7 +93,7 @@ func TestOldProcessClusterLocal(t *testing.T) {
9393
child := Spawn(t, "${STARTER} --local "+createEnvironmentStarterOptions())
9494
defer child.Close()
9595

96-
if ok := WaitUntilStarterReady(t, whatCluster, 1, child); ok {
96+
if ok := WaitUntilStarterReady(t, whatCluster, 3, child); ok {
9797
t.Logf("Cluster start took %s", time.Since(start))
9898
testCluster(t, insecureStarterEndpoint(0*portIncrement), false)
9999
testCluster(t, insecureStarterEndpoint(1*portIncrement), false)

test/process_cluster_multi_join_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func TestProcessClusterMultipleJoins(t *testing.T) {
5555
slave2 := Spawn(t, "${STARTER} --starter.port=8000 "+joins3+createEnvironmentStarterOptions())
5656
defer slave2.Close()
5757

58-
if ok := WaitUntilStarterReady(t, whatCluster, 1, master, slave1, slave2); ok {
58+
if ok := WaitUntilStarterReady(t, whatCluster, 3, master, slave1, slave2); ok {
5959
t.Logf("Cluster start took %s", time.Since(start))
6060
testCluster(t, "http://localhost:6000", false)
6161
testCluster(t, "http://localhost:7000", false)

test/process_cluster_recovery_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func TestProcessClusterRecovery(t *testing.T) {
109109
defer slave1.Close()
110110

111111
// Wait until recovered
112-
if ok := WaitUntilStarterReady(t, whatCluster, 1, slave1); ok {
112+
if ok := WaitUntilStarterReady(t, whatCluster, 3, slave1); ok {
113113
t.Logf("Cluster start (with recovery) took %s", time.Since(start))
114114
testCluster(t, insecureStarterEndpoint(0), false)
115115
testCluster(t, insecureStarterEndpoint(100), false)

test/server_util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ func testArangodReachable(t *testing.T, sp client.ServerProcess, timeout time.Du
249249
return
250250
}
251251
if timeout == 0 || time.Since(start) > timeout {
252-
t.Errorf("Failed to reach arangod at %s:%d (%#v)", sp.IP, sp.Port, err)
252+
t.Errorf("Failed to reach arangod at %s:%d %s", sp.IP, sp.Port, describe(err))
253253
return
254254
}
255255
time.Sleep(time.Second)
@@ -272,7 +272,7 @@ func testArangoSyncReachable(t *testing.T, sp client.ServerProcess, timeout time
272272
return
273273
}
274274
if timeout == 0 || time.Since(start) > timeout {
275-
t.Errorf("Failed to reach arangosync at %s:%d (%#v)", sp.IP, sp.Port, describe(err))
275+
t.Errorf("Failed to reach arangosync at %s:%d %s", sp.IP, sp.Port, describe(err))
276276
return
277277
}
278278
time.Sleep(time.Second)

test/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func WaitUntilStarterReady(t *testing.T, what string, requiredGoodResults int, s
151151
id := fmt.Sprintf("starter-%d", index+1)
152152
go func() {
153153
started := time.Now()
154-
if err := starter.ExpectTimeout(ctx, time.Minute*2, regexp.MustCompile(fmt.Sprintf("Your %s can now be accessed with a browser at", what)), id); err != nil {
154+
if err := starter.ExpectTimeout(ctx, time.Minute*3, regexp.MustCompile(fmt.Sprintf("Your %s can now be accessed with a browser at", what)), id); err != nil {
155155
timeSpan := time.Since(started)
156156
results <- waitUntilReadyResult{
157157
Ready: false,

0 commit comments

Comments
 (0)