Skip to content

Commit

Permalink
Refs 12758 Fixing DataReaderHistory test that checks DataWriter dispo…
Browse files Browse the repository at this point in the history
…sal behaviour.

Signed-off-by: Miguel Barro <miguelbarro@eprosima.com>
  • Loading branch information
Miguel Barro committed Nov 30, 2021
1 parent ffd86b2 commit 0052f0d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/unittest/dds/subscriber/DataReaderTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2105,13 +2105,17 @@ TEST_F(DataReaderTests, check_key_history_wholesomeness_on_unmatch)
SampleInfoSeq infos;

res = data_reader_->take_instance(samples, infos, LENGTH_UNLIMITED, handle_ok_);

// If the DataWriter is destroyed only the non-notified samples must be removed
// this operation MUST succeed
ASSERT_EQ(res, ReturnCode_t::RETCODE_OK);

data_reader_->return_loan(samples, infos);
});

// Check if the thread hangs
// wait for termination
std::this_thread::sleep_for(std::chrono::milliseconds(500));
// check expected result, if query thread hangs res = ReturnCode_t::RETCODE_OK
ASSERT_NE(res, ReturnCode_t::RETCODE_OK);
query.join();
}

Expand Down

0 comments on commit 0052f0d

Please sign in to comment.