diff --git a/tests/test-full-producer.cpp b/tests/test-full-producer.cpp
index c833181..bcb753a 100644
--- a/tests/test-full-producer.cpp
+++ b/tests/test-full-producer.cpp
@@ -15,11 +15,12 @@
  *
  * You should have received a copy of the GNU Lesser General Public License along with
  * PSync, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "PSync/full-producer.hpp"
 #include "PSync/detail/util.hpp"
 
+
 #include "tests/boost-test.hpp"
 #include "tests/io-fixture.hpp"
 #include "tests/key-chain-fixture.hpp"
@@ -87,6 +88,54 @@
   BOOST_CHECK_NO_THROW(node.onSyncData(syncInterest, goodCompressBadBlock));
 }
 
+BOOST_AUTO_TEST_CASE(SatisfyPendingInterestsBehavior)
+{
+  Name syncPrefix("/psync");
+  FullProducer::Options opts;
+  opts.ibfCount = 6;
+  FullProducer node(m_face, m_keyChain, syncPrefix, opts);
+
+  Name syncInterestName(syncPrefix);
+  node.m_iblt.appendToName(syncInterestName);
+  syncInterestName.appendNumber(1);
+  Interest syncInterest(syncInterestName);
+
+  node.addUserNode(syncPrefix);
+
+  node.onSyncInterest(syncPrefix, syncInterest);
+
+  BOOST_CHECK_EQUAL(node.m_pendingEntries.size(), 1);
+
+  // Test whether data is still sent if IBF diff is greater than default threshhold.
+  auto prefix1 = Name("/test/alice").appendNumber(1);
+  uint32_t newHash1 = psync::detail::murmurHash3(42, prefix1);
+  node.m_iblt.insert(newHash1);
+
+  auto prefix2 = Name("/test/bob").appendNumber(1);
+  uint32_t newHash2 = psync::detail::murmurHash3(42, prefix2);
+  node.m_iblt.insert(newHash2);
+
+  auto prefix3 = Name("/test/carol").appendNumber(1);
+  uint32_t newHash3 = psync::detail::murmurHash3(42, prefix3);
+  node.m_iblt.insert(newHash3);
+
+  auto prefix4 = Name("/test/david").appendNumber(1);
+  uint32_t newHash4 = psync::detail::murmurHash3(42, prefix4);
+  node.m_iblt.insert(newHash4);
+
+  auto prefix5 = Name("/test/erin").appendNumber(1);
+  uint32_t newHash5 = psync::detail::murmurHash3(42, prefix5);
+  node.m_iblt.insert(newHash5);
+
+  node.publishName(syncPrefix);
+
+  advanceClocks(10_ms);
+
+  BOOST_CHECK_EQUAL(m_face.sentData.size(), 1);
+
+  BOOST_CHECK_EQUAL(node.m_pendingEntries.empty(), true);
+}
+
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace psync::tests
diff --git a/tests/test-full-sync.cpp b/tests/test-full-sync.cpp
index c483d89..ff25728 100644
--- a/tests/test-full-sync.cpp
+++ b/tests/test-full-sync.cpp
@@ -297,7 +297,7 @@
     nodes[i]->publishName(userPrefixes[i]);
   }
 
-  advanceClocks(10_ms, 100);
+  advanceClocks(100_ms, 100);
   for (int i = 0; i < 4; i++) {
     for (int j = 0; j < 4; j++) {
       BOOST_CHECK_EQUAL(nodes[i]->getSeqNo(userPrefixes[j]).value_or(NOT_EXIST), 1);
@@ -308,7 +308,7 @@
     nodes[i]->publishName(userPrefixes[i], 4);
   }
 
-  advanceClocks(10_ms, 100);
+  advanceClocks(100_ms, 100);
   for (int i = 0; i < 4; i++) {
     for (int j = 0; j < 4; j++) {
       BOOST_CHECK_EQUAL(nodes[i]->getSeqNo(userPrefixes[j]).value_or(NOT_EXIST), 4);
@@ -464,55 +464,6 @@
   });
 }
 
-BOOST_AUTO_TEST_CASE(DelayedSecondSegment)
-{
-  addNode(0);
-
-  int i = 0;
-  detail::State state;
-  std::shared_ptr<ndn::Buffer> compressed;
-  do {
-    auto prefixToPublish = makeSubPrefix(0, i++);
-    nodes[0]->addUserNode(prefixToPublish);
-    nodes[0]->publishName(prefixToPublish);
-
-    state.addContent(Name(prefixToPublish).appendNumber(nodes[0]->m_prefixes[prefixToPublish]));
-
-    auto block = state.wireEncode();
-    compressed = detail::compress(nodes[0]->m_contentCompression, block);
-  } while (compressed->size() < (ndn::MAX_NDN_PACKET_SIZE >> 1));
-
-  advanceClocks(10_ms, 100);
-
-  Name syncInterestName(syncPrefix);
-  detail::IBLT iblt(40, nodes[0]->m_ibltCompression);
-  iblt.appendToName(syncInterestName);
-
-  nodes[0]->onSyncInterest(syncPrefix, Interest(syncInterestName));
-
-  advanceClocks(10_ms);
-
-  BOOST_CHECK_EQUAL(nodes[0]->m_segmentPublisher.m_ims.size(), 2);
-  // Expire contents from segmentPublisher
-  advanceClocks(10_ms, 100);
-  BOOST_CHECK_EQUAL(nodes[0]->m_segmentPublisher.m_ims.size(), 0);
-
-  // Get data name from face and increase segment number to form next interest
-  BOOST_REQUIRE(!faces[0]->sentData.empty());
-  Name dataName = faces[0]->sentData.front().getName();
-  Name interestName = dataName.getPrefix(-1).appendSegment(1);
-  faces[0]->sentData.clear();
-
-  nodes[0]->onSyncInterest(syncPrefix, Interest(interestName));
-  advanceClocks(10_ms);
-
-  // Should have repopulated SegmentPublisher
-  BOOST_CHECK_EQUAL(nodes[0]->m_segmentPublisher.m_ims.size(), 2);
-  // Should have received the second data segment this time
-  BOOST_REQUIRE(!faces[0]->sentData.empty());
-  BOOST_CHECK_EQUAL(faces[0]->sentData.front().getName().at(-1).toSegment(), 1);
-}
-
 BOOST_AUTO_TEST_SUITE_END()
 
 } // namespace psync::tests
