diff --git a/tests/daemon/face/lp-reliability.t.cpp b/tests/daemon/face/lp-reliability.t.cpp
index 1880074..99223df 100644
--- a/tests/daemon/face/lp-reliability.t.cpp
+++ b/tests/daemon/face/lp-reliability.t.cpp
@@ -120,14 +120,12 @@
 
   /** \brief make an LpPacket with fragment of specified size
    *  \param pktNum packet identifier, which can be extracted with \p getPktNum
-   *  \param payloadSize total payload size; if this is less than 4, 4 will be used
+   *  \param payloadSize total payload size; must be >= 4 and <= 255
    */
   static lp::Packet
   makeFrag(uint32_t pktNum, size_t payloadSize = 4)
   {
-    payloadSize = std::max(payloadSize, static_cast<size_t>(4));
-    BOOST_ASSERT(payloadSize <= 255);
-
+    BOOST_ASSERT(payloadSize >= 4 && payloadSize <= 255);
     lp::Packet pkt;
     ndn::Buffer buf(payloadSize);
     std::memcpy(buf.data(), &pktNum, sizeof(pktNum));
@@ -141,8 +139,7 @@
   static uint32_t
   getPktNum(const lp::Packet& pkt)
   {
-    BOOST_ASSERT(pkt.has<lp::FragmentField>());
-
+    BOOST_REQUIRE(pkt.has<lp::FragmentField>());
     ndn::Buffer::const_iterator begin, end;
     std::tie(begin, end) = pkt.get<lp::FragmentField>();
     if (std::distance(begin, end) < 4) {
@@ -621,7 +618,6 @@
   lp::Packet sentRetxPkt(transport->sentPackets.back().packet);
   BOOST_REQUIRE(sentRetxPkt.has<lp::TxSequenceField>());
   BOOST_CHECK_EQUAL(sentRetxPkt.get<lp::TxSequenceField>(), 4);
-  BOOST_REQUIRE(sentRetxPkt.has<lp::FragmentField>());
   BOOST_CHECK_EQUAL(getPktNum(sentRetxPkt), 1);
   BOOST_CHECK_EQUAL(linkService->getCounters().nAcknowledged, 3);
   BOOST_CHECK_EQUAL(linkService->getCounters().nRetransmitted, 0);
diff --git a/tests/daemon/mgmt/face-manager.t.cpp b/tests/daemon/mgmt/face-manager.t.cpp
index 0930374..439c220 100644
--- a/tests/daemon/mgmt/face-manager.t.cpp
+++ b/tests/daemon/mgmt/face-manager.t.cpp
@@ -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-2020,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -96,6 +96,7 @@
 
     advanceClocks(1_ms, 10); // wait for notification posted
     if (flags & REMOVE_LAST_NOTIFICATION) {
+      BOOST_REQUIRE(!m_responses.empty());
       m_responses.pop_back();
     }
 
diff --git a/tests/tools/ndn-autoconfig-server/program.t.cpp b/tests/tools/ndn-autoconfig-server/program.t.cpp
index 31731f8..88488a1 100644
--- a/tests/tools/ndn-autoconfig-server/program.t.cpp
+++ b/tests/tools/ndn-autoconfig-server/program.t.cpp
@@ -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-2020,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -39,22 +39,17 @@
 
 class AutoconfigServerFixture : public ::nfd::tests::KeyChainFixture
 {
-public:
-  AutoconfigServerFixture()
-    : face({true, true})
-  {
-  }
-
+protected:
   void
   initialize(const Options& options)
   {
     program = make_unique<Program>(options, face, m_keyChain);
-    face.processEvents(500_ms);
+    face.processEvents(1_s);
     face.sentInterests.clear();
   }
 
 protected:
-  util::DummyClientFace face;
+  util::DummyClientFace face{{true, true}};
   unique_ptr<Program> program;
 };
 
@@ -71,7 +66,7 @@
   interest.setCanBePrefix(true);
   interest.setMustBeFresh(true);
   face.receive(interest);
-  face.processEvents(500_ms);
+  face.processEvents(1_s);
 
   BOOST_REQUIRE_EQUAL(face.sentData.size(), 1);
   const Name& dataName = face.sentData[0].getName();
@@ -83,7 +78,7 @@
   Interest interest2(Name(interest.getName()).appendVersion(dataName.at(-1).toVersion() - 1));
   interest2.setCanBePrefix(false);
   face.receive(interest2);
-  face.processEvents(500_ms);
+  face.processEvents(1_s);
   BOOST_CHECK_EQUAL(face.sentData.size(), 1);
 }
 
@@ -109,12 +104,11 @@
     BOOST_CHECK(dataName.at(-2).isVersion());
     BOOST_CHECK(dataName.at(-1).isSegment());
   });
-  fetcher->onError.connect([] (uint32_t code, const std::string& msg) {
-    BOOST_FAIL(msg);
-  });
+  fetcher->onError.connect([] (auto, const auto& msg) { BOOST_FAIL(msg); });
+
   bool isComplete = false;
-  fetcher->onComplete.connect([&isComplete, nRoutablePrefixes, options] (ConstBufferPtr buffer) {
-    Block payload(tlv::Content, buffer);
+  fetcher->onComplete.connect([&] (auto buffer) {
+    Block payload(tlv::Content, std::move(buffer));
     payload.parse();
     BOOST_REQUIRE_EQUAL(payload.elements_size(), nRoutablePrefixes);
     for (size_t i = 0; i < nRoutablePrefixes; ++i) {
@@ -123,7 +117,7 @@
     isComplete = true;
   });
 
-  face.processEvents(100_ms, 2000);
+  face.processEvents(1_s);
   BOOST_CHECK(isComplete);
 }
 
@@ -136,7 +130,7 @@
   Interest interest("/localhop/nfd/rib/routable-prefixes");
   interest.setCanBePrefix(true);
   face.receive(interest);
-  face.processEvents(500_ms);
+  face.processEvents(1_s);
   BOOST_CHECK_EQUAL(face.sentData.size(), 0);
 }
 
