diff --git a/tests/daemon/face/face.t.cpp b/tests/daemon/face/face.t.cpp
index b592a24..641088f 100644
--- a/tests/daemon/face/face.t.cpp
+++ b/tests/daemon/face/face.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -101,9 +101,9 @@
   size_t nReceivedInterests = 0;
   size_t nReceivedData = 0;
   size_t nReceivedNacks = 0;
-  face1->afterReceiveInterest.connect(bind([&nReceivedInterests] { ++nReceivedInterests; }));
-  face1->afterReceiveData.connect(bind([&nReceivedData] { ++nReceivedData; }));
-  face1->afterReceiveNack.connect(bind([&nReceivedNacks] { ++nReceivedNacks; }));
+  face1->afterReceiveInterest.connect([&] (auto&&...) { ++nReceivedInterests; });
+  face1->afterReceiveData.connect([&] (auto&&...) { ++nReceivedData; });
+  face1->afterReceiveNack.connect([&] (auto&&...) { ++nReceivedNacks; });
 
   for (size_t i = 0; i < nInInterests; ++i) {
     face1->receiveInterest(*makeInterest("/JSQdqward4"), 0);
diff --git a/tests/daemon/face/internal-face.t.cpp b/tests/daemon/face/internal-face.t.cpp
index db72bcc..1f2b82a 100644
--- a/tests/daemon/face/internal-face.t.cpp
+++ b/tests/daemon/face/internal-face.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -87,9 +87,9 @@
 
   bool hasTimeout = false;
   clientFace->expressInterest(*interest,
-    bind([] { BOOST_ERROR("unexpected Data"); }),
-    bind([] { BOOST_ERROR("unexpected Nack"); }),
-    bind([&hasTimeout] { hasTimeout = true; }));
+    [] (auto&&...) { BOOST_ERROR("unexpected Data"); },
+    [] (auto&&...) { BOOST_ERROR("unexpected Nack"); },
+    [&] (auto&&...) { hasTimeout = true; });
   this->advanceClocks(1_ms, 10);
 
   BOOST_REQUIRE_EQUAL(receivedInterests.size(), 1);
@@ -106,12 +106,12 @@
 
   bool hasReceivedData = false;
   clientFace->expressInterest(*interest,
-    [&hasReceivedData] (const Interest&, const Data& data) {
+    [&] (const Interest&, const Data& data) {
       hasReceivedData = true;
       BOOST_CHECK_EQUAL(data.getName(), "/PQstEJGdL/aI7oCrDXNX");
     },
-    bind([] { BOOST_ERROR("unexpected Nack"); }),
-    bind([] { BOOST_ERROR("unexpected timeout"); }));
+    [] (auto&&...) { BOOST_ERROR("unexpected Nack"); },
+    [] (auto&&...) { BOOST_ERROR("unexpected timeout"); });
   this->advanceClocks(1_ms, 10);
 
   BOOST_REQUIRE_EQUAL(receivedInterests.size(), 1);
@@ -129,12 +129,12 @@
 
   bool hasReceivedNack = false;
   clientFace->expressInterest(*interest,
-    bind([] { BOOST_ERROR("unexpected Data"); }),
-    [&hasReceivedNack] (const Interest&, const lp::Nack& nack) {
+    [] (auto&&...) { BOOST_ERROR("unexpected Data"); },
+    [&] (const Interest&, const lp::Nack& nack) {
       hasReceivedNack = true;
       BOOST_CHECK_EQUAL(nack.getReason(), lp::NackReason::NO_ROUTE);
     },
-    bind([] { BOOST_ERROR("unexpected timeout"); }));
+    [] (auto&&...) { BOOST_ERROR("unexpected timeout"); });
   this->advanceClocks(1_ms, 10);
 
   BOOST_REQUIRE_EQUAL(receivedInterests.size(), 1);
@@ -197,9 +197,9 @@
 
   bool hasTimeout = false;
   clientFace->expressInterest(*interest,
-    bind([] { BOOST_ERROR("unexpected Data"); }),
-    bind([] { BOOST_ERROR("unexpected Nack"); }),
-    bind([&hasTimeout] { hasTimeout = true; }));
+    [] (auto&&...) { BOOST_ERROR("unexpected Data"); },
+    [] (auto&&...) { BOOST_ERROR("unexpected Nack"); },
+    [&] (auto&&...) { hasTimeout = true; });
   BOOST_CHECK_NO_THROW(this->advanceClocks(1_ms, 200));
 
   BOOST_CHECK_EQUAL(receivedInterests.size(), 0);
diff --git a/tests/daemon/face/tcp-factory.t.cpp b/tests/daemon/face/tcp-factory.t.cpp
index 95e6c2b..a6335f9 100644
--- a/tests/daemon/face/tcp-factory.t.cpp
+++ b/tests/daemon/face/tcp-factory.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -458,10 +458,10 @@
 {
   createChannel("0.0.0.0", "20070");
   factory.createFace({FaceUri("tcp4://192.0.2.1:20070"), {}, {}},
-                     bind(&CreateFaceTimeoutFixture::onFaceCreated, this, _1),
-                     bind(&CreateFaceTimeoutFixture::onConnectFailed, this, _2));
+                     std::bind(&CreateFaceTimeoutFixture::onFaceCreated, this, _1),
+                     std::bind(&CreateFaceTimeoutFixture::onConnectFailed, this, _2));
 
-  BOOST_REQUIRE_EQUAL(limitedIo.run(1, 10_s), LimitedIo::EXCEED_OPS);
+  BOOST_CHECK_EQUAL(limitedIo.run(1, 10_s), LimitedIo::EXCEED_OPS);
   BOOST_CHECK(face == nullptr);
 }
 
diff --git a/tests/daemon/face/websocket-channel-fixture.hpp b/tests/daemon/face/websocket-channel-fixture.hpp
index 69b2e9b..e6e1e9f 100644
--- a/tests/daemon/face/websocket-channel-fixture.hpp
+++ b/tests/daemon/face/websocket-channel-fixture.hpp
@@ -38,7 +38,8 @@
 {
 protected:
   shared_ptr<WebSocketChannel>
-  makeChannel(const boost::asio::ip::address& addr, uint16_t port = 0, optional<size_t> mtu = nullopt) final
+  makeChannel(const boost::asio::ip::address& addr, uint16_t port = 0,
+              optional<size_t> mtu = nullopt) final
   {
     if (port == 0)
       port = getNextPort();
@@ -55,7 +56,7 @@
     listenerChannel = makeChannel(addr, 20030);
     listenerChannel->setPingInterval(pingInterval);
     listenerChannel->setPongTimeout(pongTimeout);
-    listenerChannel->listen(bind(&WebSocketChannelFixture::listenerOnFaceCreated, this, _1));
+    listenerChannel->listen(std::bind(&WebSocketChannelFixture::listenerOnFaceCreated, this, _1));
   }
 
   void
@@ -65,9 +66,9 @@
     client.clear_error_channels(websocketpp::log::elevel::all);
 
     client.init_asio(&g_io);
-    client.set_open_handler(bind(&WebSocketChannelFixture::clientHandleOpen, this, _1));
-    client.set_message_handler(bind(&WebSocketChannelFixture::clientHandleMessage, this, _1, _2));
-    client.set_ping_handler(bind(&WebSocketChannelFixture::clientHandlePing, this, _1, _2));
+    client.set_open_handler(std::bind(&WebSocketChannelFixture::clientHandleOpen, this, _1));
+    client.set_message_handler(std::bind(&WebSocketChannelFixture::clientHandleMessage, this, _1, _2));
+    client.set_ping_handler(std::bind(&WebSocketChannelFixture::clientHandlePing, this, _1, _2));
 
     websocketpp::lib::error_code ec;
     auto con = client.get_connection(FaceUri(listenerEp, "ws").toString(), ec);
@@ -100,20 +101,16 @@
   listenerOnFaceCreated(const shared_ptr<Face>& newFace)
   {
     BOOST_REQUIRE(newFace != nullptr);
-    newFace->afterReceiveInterest.connect(bind(&WebSocketChannelFixture::faceAfterReceiveInterest, this, _1));
+    newFace->afterReceiveInterest.connect([this] (const auto& interest, const auto&) {
+      faceReceivedInterests.push_back(interest);
+      limitedIo.afterOp();
+    });
     connectFaceClosedSignal(*newFace, [this] { limitedIo.afterOp(); });
     listenerFaces.push_back(newFace);
     limitedIo.afterOp();
   }
 
   void
-  faceAfterReceiveInterest(const Interest& interest)
-  {
-    faceReceivedInterests.push_back(interest);
-    limitedIo.afterOp();
-  }
-
-  void
   clientHandleOpen(websocketpp::connection_hdl hdl)
   {
     clientHandle = hdl;
@@ -131,8 +128,8 @@
   clientHandlePing(websocketpp::connection_hdl, std::string)
   {
     auto now = time::steady_clock::now();
-    if (m_prevPingRecvTime != time::steady_clock::TimePoint()) {
-      measuredPingInterval = now - m_prevPingRecvTime;
+    if (m_prevPingRecvTime != time::steady_clock::time_point()) {
+      measuredPingIntervals.push_back(now - m_prevPingRecvTime);
     }
     m_prevPingRecvTime = now;
 
@@ -147,13 +144,13 @@
   websocketpp::connection_hdl clientHandle;
   std::vector<std::string> clientReceivedMessages;
 
-  time::steady_clock::Duration measuredPingInterval;
+  std::vector<time::nanoseconds> measuredPingIntervals;
   // set clientShouldPong to false to disable the pong response,
   // which will eventually cause a timeout in listenerChannel
   bool clientShouldPong = true;
 
 private:
-  time::steady_clock::TimePoint m_prevPingRecvTime;
+  time::steady_clock::time_point m_prevPingRecvTime;
 };
 
 } // namespace tests
diff --git a/tests/daemon/face/websocket-channel.t.cpp b/tests/daemon/face/websocket-channel.t.cpp
index d9fe929..5772daa 100644
--- a/tests/daemon/face/websocket-channel.t.cpp
+++ b/tests/daemon/face/websocket-channel.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -175,13 +175,17 @@
 {
   auto address = getTestIp(F::value, AddressScope::Loopback);
   SKIP_IF_IP_UNAVAILABLE(address);
-  const auto pingInterval = 1200_ms;
+  const auto pingInterval = 1500_ms;
   this->initialize(address, pingInterval);
 
-  BOOST_CHECK_EQUAL(limitedIo.run(2, // clientHandlePing
-                                  pingInterval * 3), LimitedIo::EXCEED_OPS);
-  BOOST_CHECK_LE(measuredPingInterval, pingInterval * 1.1);
-  BOOST_CHECK_GE(measuredPingInterval, pingInterval * 0.9);
+  BOOST_CHECK_EQUAL(limitedIo.run(5, // clientHandlePing
+                                  5 * pingInterval + 1_s), LimitedIo::EXCEED_OPS);
+  BOOST_CHECK_EQUAL(measuredPingIntervals.size(), 4);
+
+  auto avgPingInterval = std::accumulate(measuredPingIntervals.begin(), measuredPingIntervals.end(), 0_ns);
+  avgPingInterval /= measuredPingIntervals.size();
+  BOOST_CHECK_LE(avgPingInterval, pingInterval * 1.1);
+  BOOST_CHECK_GE(avgPingInterval, pingInterval * 0.9);
 }
 
 BOOST_AUTO_TEST_CASE_TEMPLATE(SetPongTimeOut, F, AddressFamilies)
diff --git a/tests/daemon/face/websocket-transport-fixture.hpp b/tests/daemon/face/websocket-transport-fixture.hpp
index 32934ab..b1700ed 100644
--- a/tests/daemon/face/websocket-transport-fixture.hpp
+++ b/tests/daemon/face/websocket-transport-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2019,  Regents of the University of California,
+ * Copyright (c) 2014-2021,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -62,11 +62,11 @@
     server.clear_error_channels(websocketpp::log::elevel::all);
 
     server.init_asio(&g_io);
-    server.set_open_handler(bind(&WebSocketTransportFixture::serverHandleOpen, this, _1));
-    server.set_close_handler(bind(&WebSocketTransportFixture::serverHandleClose, this));
-    server.set_message_handler(bind(&WebSocketTransportFixture::serverHandleMessage, this, _2));
-    server.set_pong_handler(bind(&WebSocketTransportFixture::serverHandlePong, this));
-    server.set_pong_timeout_handler(bind(&WebSocketTransportFixture::serverHandlePongTimeout, this));
+    server.set_open_handler(std::bind(&WebSocketTransportFixture::serverHandleOpen, this, _1));
+    server.set_close_handler(std::bind(&WebSocketTransportFixture::serverHandleClose, this));
+    server.set_message_handler(std::bind(&WebSocketTransportFixture::serverHandleMessage, this, _2));
+    server.set_pong_handler(std::bind(&WebSocketTransportFixture::serverHandlePong, this));
+    server.set_pong_timeout_handler(std::bind(&WebSocketTransportFixture::serverHandlePongTimeout, this));
     server.set_pong_timeout(pongTimeout.count());
 
     server.set_reuse_addr(true);
@@ -84,9 +84,9 @@
     client.clear_error_channels(websocketpp::log::elevel::all);
 
     client.init_asio(&g_io);
-    client.set_open_handler(bind(&WebSocketTransportFixture::clientHandleOpen, this, _1));
-    client.set_message_handler(bind(&WebSocketTransportFixture::clientHandleMessage, this, _2));
-    client.set_ping_handler(bind(&WebSocketTransportFixture::clientHandlePing, this));
+    client.set_open_handler(std::bind(&WebSocketTransportFixture::clientHandleOpen, this, _1));
+    client.set_message_handler(std::bind(&WebSocketTransportFixture::clientHandleMessage, this, _2));
+    client.set_ping_handler(std::bind(&WebSocketTransportFixture::clientHandlePing, this));
 
     websocketpp::lib::error_code ec;
     auto con = client.get_connection(uri, ec);
