Skip to content

Commit 78e0cd2

Browse files
frankistcodebot
authored andcommitted
du-high: fix du-high unit test
1 parent dc16d6d commit 78e0cd2

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

tests/integrationtests/du_high/du_high_test.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,19 @@ TEST_F(du_high_tester, when_ue_context_setup_release_starts_then_drb_activity_st
158158
this->test_logger.info("STATUS: RRC Release started being scheduled...");
159159

160160
// Ensure that DRBs stop being scheduled at this point, even if it takes a while for the UE release to complete.
161+
unsigned drb_data_count = 0;
161162
while (cu_notifier.last_f1ap_msgs.empty()) {
162163
run_slot();
163164
const dl_msg_alloc* pdsch = find_ue_pdsch(rnti, phy.cells[0].last_dl_res.value().dl_res->ue_grants);
164165
if (pdsch != nullptr) {
165-
// PDSCH scheduled. Ensure it was for SRB1 (DRB1 might fill the rest of the TB though).
166-
ASSERT_NE(find_ue_pdsch_with_lcid(rnti, LCID_SRB1, phy.cells[0].last_dl_res.value().dl_res->ue_grants), nullptr);
166+
// PDSCH scheduled. Ensure it was for SRB1.
167+
// Note: There might be at most one single DRB1 PDSCH that smuggles in after the RRC Release due to race
168+
// conditions.
169+
auto* drb_pdsch = find_ue_pdsch_with_lcid(rnti, LCID_MIN_DRB, phy.cells[0].last_dl_res.value().dl_res->ue_grants);
170+
if (drb_pdsch != nullptr) {
171+
drb_data_count++;
172+
ASSERT_LT(drb_data_count, 2) << "More than 1 PDSCH grant for DRB data was scheduled after RRC Release";
173+
}
167174
}
168175
}
169176
}

tests/unittests/du_manager/du_ue/ue_manager_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ TEST_F(du_ue_manager_tester, when_ue_is_being_removed_then_ue_notifiers_get_disc
277277
// TEST: UE notifiers are disconnected.
278278
mac_dummy.last_dl_bs.reset();
279279
srb1.on_buffer_state_update(10);
280-
ASSERT_FALSE(mac_dummy.last_dl_bs.has_value());
280+
ASSERT_TRUE(not mac_dummy.last_dl_bs.has_value() or mac_dummy.last_dl_bs.value().bs == 0);
281281
}
282282

283283
class du_ue_manager_rlf_tester : public du_ue_manager_tester

0 commit comments

Comments
 (0)