Skip to content

Commit 38803c2

Browse files
committed
Fix test
1 parent ad5ad32 commit 38803c2

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

worker/src/test/scala/org/apache/celeborn/service/deploy/worker/storage/StorageManagerSuite.scala

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import org.mockito.stubbing.Stubber
2626

2727
import org.apache.celeborn.CelebornFunSuite
2828
import org.apache.celeborn.common.CelebornConf
29-
import org.apache.celeborn.common.CelebornConf.{WORKER_DISK_RESERVE_SIZE, WORKER_GRACEFUL_SHUTDOWN_ENABLED, WORKER_GRACEFUL_SHUTDOWN_RECOVER_PATH}
29+
import org.apache.celeborn.common.CelebornConf.{WORKER_DISK_RESERVE_SIZE, WORKER_GRACEFUL_SHUTDOWN_ENABLED, WORKER_GRACEFUL_SHUTDOWN_RECOVER_PATH, WORKER_STORAGE_DIRS}
3030
import org.apache.celeborn.common.identity.UserIdentifier
3131
import org.apache.celeborn.common.meta.{DiskInfo, DiskStatus}
3232
import org.apache.celeborn.common.protocol.{PartitionLocation, PartitionType, StorageInfo}
@@ -115,11 +115,12 @@ class StorageManagerSuite extends CelebornFunSuite with MockitoHelper {
115115
}
116116

117117
test("[CELEBORN-2310] Ensure createFile rejected with disks are full, but status is HEALTHY") {
118-
val conf = new CelebornConf().set(WORKER_DISK_RESERVE_SIZE, Utils.byteStringAsBytes("5g"))
118+
val conf = new CelebornConf().set(WORKER_DISK_RESERVE_SIZE, Utils.byteStringAsBytes("5g")).set(
119+
WORKER_STORAGE_DIRS,
120+
Seq("/"))
119121
val storageManager = new StorageManager(conf, new WorkerSource(conf))
120122
val spyStorageManager = spy(storageManager)
121-
122-
val diskInfo = new DiskInfo("mountPoint", List.empty, null, conf)
123+
val diskInfo = new DiskInfo("/", List.empty, null, conf)
123124
diskInfo.setUsableSpace(-1L)
124125
// Should fail even if the status is HEALTHY
125126
diskInfo.setStatus(DiskStatus.HEALTHY)
@@ -142,7 +143,7 @@ class StorageManagerSuite extends CelebornFunSuite with MockitoHelper {
142143
assert(e.getMessage.equals(
143144
s"No available disks! suggested mountPoint ${partitionLocation.getStorageInfo.getMountPoint}"))
144145
case e: Throwable =>
145-
fail(s"Should throw IOException, but got ${e.getClass.getSimpleName}")
146+
fail(s"Should throw IOException, but got ${e.getClass.getSimpleName}", e)
146147
}
147148
}
148149

@@ -151,7 +152,7 @@ class StorageManagerSuite extends CelebornFunSuite with MockitoHelper {
151152
new PartitionLocation(0, epoch, "localhost", 0, 0, 0, 0, PartitionLocation.Mode.PRIMARY)
152153
val storageInfo: StorageInfo = new StorageInfo(
153154
StorageInfo.Type.HDD,
154-
"mountPoint",
155+
"/",
155156
false,
156157
"filePath",
157158
StorageInfo.ALL_TYPES_AVAILABLE_MASK,

0 commit comments

Comments
 (0)