morrySnow commented on code in PR #58623:
URL: https://github.com/apache/doris/pull/58623#discussion_r2580066261
##########
fe/fe-core/src/test/java/org/apache/doris/qe/SimpleSchedulerTest.java:
##########
@@ -193,20 +193,30 @@ public void testGetHostAbnormal() throws UserException,
InterruptedException {
scanRangeLocation5.setBackendId(be5.getId());
locations.add(scanRangeLocation5);
- for (int i = 0; i <= Config.do_add_backend_black_list_threshold_count;
i++) {
- SimpleScheduler.addToBlacklist(be1.getId(), "test");
- SimpleScheduler.addToBlacklist(be2.getId(), "test");
- SimpleScheduler.addToBlacklist(be3.getId(), "test");
- SimpleScheduler.addToBlacklist(be4.getId(), "test");
- SimpleScheduler.addToBlacklist(be5.getId(), "test");
- }
- try {
- SimpleScheduler.getHost(locations.get(0).backend_id, locations,
backends, ref);
- Assert.fail();
- } catch (UserException e) {
- System.out.println(e.getMessage());
+ boolean addBacklistSuccess = false;
+ // retry multiple times, because the UpdateBlacklistThread delete
blacklist backend every second,
+ // so the SimpleScheduler.getHost() maybe not throw exception because
the backend not exists in
+ // the blacklist
+ for (int retryTimes = 0; retryTimes < 20; retryTimes++) {
+ for (int i = 0; i <=
Config.do_add_backend_black_list_threshold_count; i++) {
+ SimpleScheduler.addToBlacklist(be1.getId(), "test");
+ SimpleScheduler.addToBlacklist(be2.getId(), "test");
+ SimpleScheduler.addToBlacklist(be3.getId(), "test");
+ SimpleScheduler.addToBlacklist(be4.getId(), "test");
Review Comment:
need sleep? or not?
--
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]