Skip to content

removed superfluous error message #229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ go:
- "1.12.x"

env:
- TEST_SUITE=run-tests-local-process ARANGODB=arangodb:3.3 STARTER_MODES="single,cluster,activefailover"
- TEST_SUITE=run-tests-docker ARANGODB=arangodb:3.3 STARTER_MODES="single,cluster,activefailover"
- TEST_SUITE=run-tests-local-process ARANGODB=arangodb/arangodb:latest STARTER_MODES="single,cluster,activefailover"
- TEST_SUITE=run-tests-docker ARANGODB=arangodb/arangodb:latest STARTER_MODES="single,cluster,activefailover"
- TEST_SUITE=run-tests-local-process ARANGODB=arangodb/arangodb-preview:latest STARTER_MODES="single,cluster,activefailover"
- TEST_SUITE=run-tests-docker ARANGODB=arangodb/arangodb-preview:latest STARTER_MODES="single,cluster,activefailover"
- VERBOSE=1 TEST_SUITE=run-tests-local-process ARANGODB=arangodb:3.3 STARTER_MODES="single,cluster,activefailover"
- VERBOSE=1 TEST_SUITE=run-tests-docker ARANGODB=arangodb:3.3 STARTER_MODES="single,cluster,activefailover"
- VERBOSE=1 TEST_SUITE=run-tests-local-process ARANGODB=arangodb/arangodb:latest STARTER_MODES="single,cluster,activefailover"
- VERBOSE=1 TEST_SUITE=run-tests-docker ARANGODB=arangodb/arangodb:latest STARTER_MODES="single,cluster,activefailover"
- VERBOSE=1 TEST_SUITE=run-tests-local-process ARANGODB=arangodb/arangodb-preview:latest STARTER_MODES="single,cluster,activefailover"
- VERBOSE=1 TEST_SUITE=run-tests-docker ARANGODB=arangodb/arangodb-preview:latest STARTER_MODES="single,cluster,activefailover"

script: make $TEST_SUITE

Expand All @@ -23,4 +23,4 @@ before_install:
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y install docker-ce
- sudo apt-get -y install docker-ce
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ run-tests-local-process: build test-images
-e STARTER=/usr/code/bin/linux/amd64/arangodb \
-e TEST_MODES=localprocess \
-e STARTER_MODES=$(STARTER_MODES) \
-e VERBOSE=$(VERBOSE) \
-e ENTERPRISE=$(ENTERPRISE) \
-e TESTOPTIONS=$(TESTOPTIONS) \
-e DEBUG_CLUSTER=$(DEBUG_CLUSTER) \
Expand Down
3 changes: 2 additions & 1 deletion service/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func terminateProcess(log zerolog.Logger, p Process, name string, killTimeout ti
if err := p.Terminate(); err != nil {
log.Warn().Err(err).Msgf("Failed to terminate %s", name)
}
p.Wait()
p.Wait()
log.Debug().Msgf("%s terminated", name)
}()
select {
Expand All @@ -98,5 +98,6 @@ func terminateProcess(log zerolog.Logger, p Process, name string, killTimeout ti
// Kill the process
log.Warn().Msgf("Killing %s...", name)
p.Kill()
p.Wait()
}
}
5 changes: 4 additions & 1 deletion service/runner_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ func (p *process) Wait() {
if p.isChild {
ps, err := proc.Wait()
if err != nil {
p.log.Error().Err(err).Msgf("Wait on %d failed", proc.Pid)
if err.Error() != "wait: no child processes" {
// on terminate Wait might be called twice
p.log.Error().Err(err).Msgf("Wait on %d failed", proc.Pid)
}
} else if ps.ExitCode() != 0 {
if ws, ok := ps.Sys().(syscall.WaitStatus); ok {
l := p.log.Info()
Expand Down
4 changes: 2 additions & 2 deletions test/docker_install_go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if [ ! -z "$(which apt-get)" ]; then
esac; \
\
url="https://golang.org/dl/go${GOLANG_VERSION}.${goRelArch}.tar.gz"; \
wget -O go.tgz "$url"; \
wget -q -O go.tgz "$url"; \
sha256sum *go.tgz ; \
echo "${goRelSha256} *go.tgz" | sha256sum -c -; \
tar -C /usr/local -xzf go.tgz; \
Expand Down Expand Up @@ -73,7 +73,7 @@ else
x86) export GO386='387' ;; \
esac; \
\
wget -O go.tgz "https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz"; \
wget -q -O go.tgz "https://golang.org/dl/go$GOLANG_VERSION.src.tar.gz"; \
sha256sum *go.tgz ; \
echo '4affc3e610cd8182c47abbc5b0c0e4e3c6a2b945b55aaa2ba952964ad9df1467 *go.tgz' | sha256sum -c -; \
tar -C /usr/local -xzf go.tgz; \
Expand Down
6 changes: 3 additions & 3 deletions test/process_cluster_local_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestProcessClusterLocal(t *testing.T) {
child := Spawn(t, "${STARTER} --starter.local "+createEnvironmentStarterOptions())
defer child.Close()

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

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

if ok := WaitUntilStarterReady(t, whatCluster, 1, child); ok {
if ok := WaitUntilStarterReady(t, whatCluster, 3, child); ok {
t.Logf("Cluster start took %s", time.Since(start))
testCluster(t, insecureStarterEndpoint(0*portIncrement), false)
testCluster(t, insecureStarterEndpoint(1*portIncrement), false)
Expand Down
2 changes: 1 addition & 1 deletion test/process_cluster_multi_join_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func TestProcessClusterMultipleJoins(t *testing.T) {
slave2 := Spawn(t, "${STARTER} --starter.port=8000 "+joins3+createEnvironmentStarterOptions())
defer slave2.Close()

if ok := WaitUntilStarterReady(t, whatCluster, 1, master, slave1, slave2); ok {
if ok := WaitUntilStarterReady(t, whatCluster, 3, master, slave1, slave2); ok {
t.Logf("Cluster start took %s", time.Since(start))
testCluster(t, "http://localhost:6000", false)
testCluster(t, "http://localhost:7000", false)
Expand Down
2 changes: 1 addition & 1 deletion test/process_cluster_recovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func TestProcessClusterRecovery(t *testing.T) {
defer slave1.Close()

// Wait until recovered
if ok := WaitUntilStarterReady(t, whatCluster, 1, slave1); ok {
if ok := WaitUntilStarterReady(t, whatCluster, 3, slave1); ok {
t.Logf("Cluster start (with recovery) took %s", time.Since(start))
testCluster(t, insecureStarterEndpoint(0), false)
testCluster(t, insecureStarterEndpoint(100), false)
Expand Down
4 changes: 2 additions & 2 deletions test/server_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func testArangodReachable(t *testing.T, sp client.ServerProcess, timeout time.Du
return
}
if timeout == 0 || time.Since(start) > timeout {
t.Errorf("Failed to reach arangod at %s:%d (%#v)", sp.IP, sp.Port, err)
t.Errorf("Failed to reach arangod at %s:%d %s", sp.IP, sp.Port, describe(err))
return
}
time.Sleep(time.Second)
Expand All @@ -272,7 +272,7 @@ func testArangoSyncReachable(t *testing.T, sp client.ServerProcess, timeout time
return
}
if timeout == 0 || time.Since(start) > timeout {
t.Errorf("Failed to reach arangosync at %s:%d (%#v)", sp.IP, sp.Port, describe(err))
t.Errorf("Failed to reach arangosync at %s:%d %s", sp.IP, sp.Port, describe(err))
return
}
time.Sleep(time.Second)
Expand Down
2 changes: 1 addition & 1 deletion test/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func WaitUntilStarterReady(t *testing.T, what string, requiredGoodResults int, s
id := fmt.Sprintf("starter-%d", index+1)
go func() {
started := time.Now()
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 {
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 {
timeSpan := time.Since(started)
results <- waitUntilReadyResult{
Ready: false,
Expand Down