8000 [UT] Fix unstable ut for Restore cause by @Mocked annotation for SystemInfoService (backport #60078) by mergify[bot] · Pull Request #60083 · StarRocks/starrocks · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[UT] Fix unstable ut for Restore cause by @Mocked annotation for SystemInfoService (backport #60078) #60083

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10000
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ public Repository getRepo(long repoId) {
}
}

@Mocked
private SystemInfoService systemInfoService;

@Injectable
private Repository repo = new Repository(repoId, "repo", false, "bos://my_repo",
new BlobStorage("broker", Maps.newHashMap()));
Expand Down Expand Up @@ -233,6 +230,7 @@ public Database getDb(long dbId) {

@Test
public void testRunBackupMultiSubPartitionTable() {
SystemInfoService systemInfoService = new SystemInfoService();
new Expectations() {
{

Expand All @@ -256,7 +254,7 @@ public void testRunBackupMultiSubPartitionTable() {
beIds.add(CatalogMocker.BACKEND1_ID);
beIds.add(CatalogMocker.BACKEND2_ID);
beIds.add(CatalogMocker.BACKEND3_ID);
new Expectations() {
new Expectations(systemInfoService) {
{
systemInfoService.getNodeSelector().seqChooseBackendIds(anyInt, anyBoolean, anyBoolean, null);
minTimes = 0;
Expand Down Expand Up @@ -420,6 +418,7 @@ public Table getTable(Long dbId, Long tableId) {

@Test
public void testRunBackupRangeTable() {
SystemInfoService systemInfoService = new SystemInfoService();
new Expectations() {
{
globalStateMgr.getLocalMetastore().getDb(anyLong);
Expand All @@ -440,7 +439,7 @@ public void testRunBackupRangeTable() {
beIds.add(CatalogMocker.BACKEND1_ID);
beIds.add(CatalogMocker.BACKEND2_ID);
beIds.add(CatalogMocker.BACKEND3_ID);
new Expectations() {
new Expectations(systemInfoService) {
{
systemInfoService.getNodeSelector().seqChooseBackendIds(anyInt, anyBoolean, anyBoolean, null);
minTimes = 0;
Expand Down Expand Up @@ -591,6 +590,7 @@ public Table getTable(Long dbId, Long tableId) {

@Test
public void testRunBackupListTable() {
SystemInfoService systemInfoService = new SystemInfoService();
new Expectations() {
{
globalStateMgr.getLocalMetastore().getDb(anyLong);
Expand All @@ -611,7 +611,7 @@ public void testRunBackupListTable() {
beIds.add(CatalogMocker.BACKEND1_ID);
beIds.add(CatalogMocker.BACKEND2_ID);
beIds.add(CatalogMocker.BACKEND3_ID);
new Expectations() {
new Expectations(systemInfoService) {
{
systemInfoService.getNodeSelector().seqChooseBackendIds(anyInt, anyBoolean, anyBoolean, null);
minTimes = 0;
Expand Down Expand Up @@ -809,6 +809,7 @@ public void testColocateRestore() {

@Test
public void testRestoreView() {
SystemInfoService systemInfoService = new SystemInfoService();
new Expectations() {
{
globalStateMgr.getLocalMetastore().getDb(anyLong);
Expand Down Expand Up @@ -890,7 +891,7 @@ public synchronized QueryStatement getQueryStatement() throws UserException {
}
};

new Expectations() {
new Expectations(systemInfoService) {
{
systemInfoService.checkExceedDiskCapacityLimit((Multimap<Long, Long>) any, anyBoolean);
minTimes = 0;
Expand Down
Loading
0