netudima commented on code in PR #3996:
URL: https://github.com/apache/cassandra/pull/3996#discussion_r2016320627
##########
test/unit/org/apache/cassandra/db/commitlog/CommitlogShutdownTest.java:
##########
@@ -85,15 +87,23 @@ public void testShutdownWithPendingTasks() throws Exception
// force creating several commitlog files
for (int i = 0; i < 10; i++)
{
- CommitLog.instance.add(m);
+ m.apply();
}
- // schedule discarding completed segments and immediately issue a
shutdown
- TableId tableId = m.getTableIds().iterator().next();
- CommitLog.instance.discardCompletedSegments(tableId,
CommitLogPosition.NONE, CommitLog.instance.getCurrentPosition());
- CommitLog.instance.shutdownBlocking();
+ StorageService.instance.drain();
Review Comment:
yes, I would also love to see an isolated unit test here but it looks quite
complicated now to make it (due to a lot of hidden uncontrolled background
activities triggered by dependent code), so I have applied minimal efforts for
a maximum result to make the test stable and to have it to test something real
:-)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]