]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: Don't fail if `socat` exits at the end of remote backend unix tests 4041/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 24 Jun 2016 16:36:22 +0000 (18:36 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 24 Jun 2016 16:36:22 +0000 (18:36 +0200)
Every time I managed to reproduce that failure we sometimes get on
travis, I have:

```
*** No errors detected
2016/06/24 17:28:00 socat[28022] E write(4, 0x6f33a0, 1): Broken pipe
ERROR: Unable to stop "UNIX socket" test service: service (28022) not running
```

And that actually might make sense because `socat` is going to exit
as soon as it gets an EOF, which will happen when the
`remotebackend_unix.test` process stops. We would then be in a race
to stop the `socat` process before it stops existing.

modules/remotebackend/testrunner.sh

index 6b06504916dcd476eb103b1742da9eada51c2853..86b85b220849d4e30f272ef9ad92070ca549cb5d 100755 (executable)
@@ -186,9 +186,8 @@ function stop_unix() {
   fi
 
   if ! kill -0 ${socat_pid} 2>/dev/null; then
-    # should never happen - did the test crashed the service?
-    echo >&2 "ERROR: Unable to stop \"UNIX socket\" test service: service (${socat_pid}) not running"
-    exit 69
+    # might very well happen, since socat will stop after getting EOF
+    return 0
   fi
 
   kill -TERM ${socat_pid}