travis: be nice
authorMichael Wallner <mike@php.net>
Tue, 29 Sep 2020 08:55:15 +0000 (10:55 +0200)
committerMichael Wallner <mike@php.net>
Tue, 29 Sep 2020 08:55:15 +0000 (10:55 +0200)
.travis.yml
CMakeConfig.txt
test/lib/MemcachedCluster.cpp

index 1131323d5e7a9715560e34f83d0e57d800b9a564..7ad1566bb881e58ff91516f1e2e60566652b81a0 100644 (file)
@@ -43,7 +43,7 @@ script:
  - cd build
  - cmake -DBUILD_TESTING=ON -DCMAKE_BUILD_TYPE=${BUILD} -DENABLE_SASL=${SASL} -DMEMCACHED_BINARY=${PREFIX:-/usr}/bin/memcached ..
  - make -j2
- - make test
+ - make test VERBOSE=1
  - make install DESTDIR=.
 
 #before_cache:
index 7f611de5d7a3216b2b1738d1c4b95a9aa00d0d12..b99b507dae388c3f7e7aa83582c2f5c845fd13ac 100644 (file)
@@ -44,8 +44,11 @@ set(ENABLE_SANITIZERS ""
 if(BUILD_TESTING)
     set(MEMCACHED_BINARY "/usr/bin/memcached"
         CACHE FILEPATH "memcached binary")
-    set(CMAKE_CTEST_ARGUMENTS "--output-on-failure;-j2;--repeat;until-pass:2"
-        ) # available since CMake 3.17
+    set(CMAKE_CTEST_ARGUMENTS "--output-on-failure")
+    if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17)
+        # available since CMake 3.17
+        list(APPEND CMAKE_CTEST_ARGUMENTS -j2 --repeat until-pass:2)
+    endif()
 endif()
 
 if(BUILD_DOCS)
index c03bacce1f4124382b7f4886bb856d79f80f8b95..63155e94aba6389c05ca1d6a1bf37b42a46445ea 100644 (file)
@@ -9,7 +9,11 @@ void MemcachedCluster::init() {
   Retry cluster_is_listening([this]() {
     return cluster.isListening();
   });
-  REQUIRE(cluster_is_listening());
+  while (!cluster_is_listening()) {
+    cluster.stop();
+    cluster.wait();
+    cluster.start();
+  }
 
   REQUIRE(memcached_create(&memc));
   for (const auto &server : cluster.getServers()) {