Commit d2a03322 authored by Eric Cano's avatar Eric Cano
Browse files

Fixed the end of session logic for the recall report packer to eliminate the...

Fixed the end of session logic for the recall report packer to eliminate the memory leak worked around in the previous commits.

The error logs are now gone.
Adapted the recall report packer unit test.
parent 352db341
......@@ -33,7 +33,7 @@ namespace cta {
~MockRetrieveMount() throw() {
}
std::unique_ptr<cta::RetrieveJob> getNextJob() {
std::unique_ptr<cta::RetrieveJob> getNextJob() override {
getJobs++;
if(m_jobs.empty()) {
return std::unique_ptr<cta::RetrieveJob>();
......@@ -44,19 +44,20 @@ namespace cta {
}
}
virtual std::string getMountTransactionId() const {
virtual std::string getMountTransactionId() const override {
return "1234567890";
}
virtual void complete() { completes ++; }
void abort() override { completes ++; }
virtual void abort() { completes ++; }
void diskComplete() override { completes ++;}
void diskComplete() { completes ++;};
void tapeComplete() override {};
void tapeComplete() {};
bool bothSidesComplete() override { return false; }
void setDriveStatus(cta::common::DriveStatus status) override {};
bool bothSidesComplete() { return false; }
private:
......
......@@ -145,7 +145,7 @@ void RecallReportPacker::ReportEndofSession::execute(RecallReportPacker& parent)
//ReportEndofSession::goingToEnd
//------------------------------------------------------------------------------
bool RecallReportPacker::ReportEndofSession::goingToEnd() {
return false;
return true;
}
//------------------------------------------------------------------------------
......@@ -163,7 +163,6 @@ void RecallReportPacker::ReportDriveStatus::execute(RecallReportPacker& parent){
//ReportDriveStatus::goingToEnd
//------------------------------------------------------------------------------
bool RecallReportPacker::ReportDriveStatus::goingToEnd() {
if(m_status==cta::common::DriveStatus::Unmounting) return true;
return false;
}
......@@ -192,7 +191,7 @@ void RecallReportPacker::ReportEndofSessionWithErrors::execute(RecallReportPacke
//ReportEndofSessionWithErrors::goingToEnd
//------------------------------------------------------------------------------
bool RecallReportPacker::ReportEndofSessionWithErrors::goingToEnd() {
return false;
return true;
}
//------------------------------------------------------------------------------
......
......@@ -98,9 +98,11 @@ TEST_F(castor_tape_tapeserver_daemon_RecallReportPackerTest, RecallReportPackerN
rrp.setDiskDone();
rrp.setTapeDone();
rrp.reportDriveStatus(cta::common::DriveStatus::Unmounting);
rrp.reportEndOfSession();
rrp.reportTestGoingToEnd();
// rrp.reportTestGoingToEnd();
rrp.waitThread();
std::string temp = log.getLog();
......@@ -153,9 +155,11 @@ TEST_F(castor_tape_tapeserver_daemon_RecallReportPackerTest, RecallReportPackerB
rrp.setDiskDone();
rrp.setTapeDone();
rrp.reportDriveStatus(cta::common::DriveStatus::Unmounting);
rrp.reportEndOfSession();
rrp.reportTestGoingToEnd();
// rrp.reportTestGoingToEnd();
rrp.waitThread();
const std::string temp = log.getLog();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment