name: dbg-mac (<?=DEF["macOS"]?>, <?=DEF[DEF["macOS"]]?>, <?=DEF[DEF[DEF["macOS"]]]["ver"]?>)
runs-on: <?=DEF["macOS"]?> #
env:
- CFLAGS: -O0 --coverage
+ CFLAGS: -O0 --coverage
CXXFLAGS: -O0 --coverage
+ OS_VND: macOS
+ OS_VER: <?=DEF["macOS"]?> #
+ CC_VND: <?=DEF[DEF["macOS"]]?> #
+ CC_VER: <?=DEF[DEF[DEF["macOS"]]]["ver"]?> #
continue-on-error: true
steps:
- uses: actions/checkout@v2
name: dbg-mac (macos-10.15, clang, apple)
runs-on: macos-10.15 #
env:
- CFLAGS: -O0 --coverage
+ CFLAGS: -O0 --coverage
CXXFLAGS: -O0 --coverage
+ OS_VND: macOS
+ OS_VER: macos-10.15 #
+ CC_VND: clang #
+ CC_VER: apple #
continue-on-error: true
steps:
- uses: actions/checkout@v2
}
}
}
+
+bool Cluster::restart() {
+ stop();
+ wait();
+ return start();
+}
bool isStopped();
bool isListening();
void wait();
+ bool restart();
private:
size_t count;
}
void ForkAndExec::pollExecReadyPipe() {
-#if __APPLE__
+#if __APPLE__ || __FreeBSD__
char c, n = 50;
do {
if (0 == read(ready[mode::READ], &c, 1)) {
void MemcachedCluster::init() {
REQUIRE(cluster.start());
- Retry cluster_is_listening([this]() {
- return cluster.isListening();
- });
- while (!cluster_is_listening()) {
- cluster.stop();
- cluster.wait();
- cluster.start();
+ while (!isListening()) {
+ cluster.restart();
}
if (auto br = getenv_else("MEMCACHED_BREAK", "0")) {
const auto &victim = servers[random_num(0UL, servers.size() - 1)];
::kill(victim.getPid(), SIGKILL);
}
+
+bool MemcachedCluster::isListening() {
+ return Retry{[this]() {return cluster.isListening();}}();
+}
void enableBuffering(bool enable = true);
void enableReplication();
void flush();
+ bool isListening();
static MemcachedCluster mixed();
static MemcachedCluster network();
REQUIRE_RC(MEMCACHED_SERVER_TEMPORARILY_DISABLED, memcached_set(memc, S("foo"), nullptr, 0, 0, 0));
REQUIRE(test.cluster.start());
- Retry cluster_is_listening{[&cluster = test.cluster] {
- return cluster.isListening();
- }};
- REQUIRE(cluster_is_listening());
+ REQUIRE(test.isListening());
Retry recovers{[memc]{
return MEMCACHED_SUCCESS == memcached_set(memc, S("foo"), nullptr, 0, 0, 0);