From 661e0420ea816d3ce6c1121967f83c628ec31344 Mon Sep 17 00:00:00 2001
From: Eric Cano <Eric.Cano@cern.ch>
Date: Tue, 14 Aug 2018 12:13:41 +0200
Subject: [PATCH] Fixed critieria of unit test.

A retry might sneak into the session (depending of end of sessions and reporting speeds).
Relaxed the test criteria for this case.
---
 .../tape/tapeserver/daemon/DataTransferSessionTest.cpp       | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp b/tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp
index ab53e0da79..b4e40d7982 100644
--- a/tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp
+++ b/tapeserver/castor/tape/tapeserver/daemon/DataTransferSessionTest.cpp
@@ -1383,7 +1383,7 @@ TEST_P(DataTransferSessionTest, DataTransferSessionGooddayMigration) {
 // This test is the same as the previous one, except that the files are deleted
 // from filesystem immediately. The disk tasks will then fail on open.
 ///
-TEST_P(DataTransferSessionTest, DISABLED_DataTransferSessionMissingFilesMigration) {
+TEST_P(DataTransferSessionTest, DataTransferSessionMissingFilesMigration) {
   
   // 0) Prepare the logger for everyone
   cta::log::StringLogger logger("dummy","tapeServerUnitTest",cta::log::DEBUG);
@@ -1520,7 +1520,8 @@ TEST_P(DataTransferSessionTest, DISABLED_DataTransferSessionMissingFilesMigratio
   tapeCriteria.vid=s_vid;
   auto tapeInfo = catalogue.getTapes(tapeCriteria);
   ASSERT_EQ(1, tapeInfo.size());
-  ASSERT_EQ(10, tapeInfo.begin()->lastFSeq);
+  // We should have max fseq at least 10. It could be higher is a retry manages to sneak in.
+  ASSERT_LE(10, tapeInfo.begin()->lastFSeq);
   ASSERT_EQ(5*1000, tapeInfo.begin()->dataOnTapeInBytes);
       
   // Check logs for drive statistics
-- 
GitLab