Task Summary
computing-unit-managing-service/src/main/scala/org/apache/texera/service/util/ComputingUnitManagingServiceException.scala (0% coverage) defines a sealed exception hierarchy plus fromKubernetes, which classifies a KubernetesClientException into a typed exception. Pure logic, no DB — a plain AnyFlatSpec covers it.
Behavior to cover
InsufficientComputingResource("CPU").getMessage == "Insufficient CPU available in the server. Please decrease the requested amount or try again later."
InsufficientComputingUnitQuota(3).getMessage == "You may only have 3 computing-unit(s) running at the same time"
InternalError().getMessage == the default "The server encountered an internal error while processing your request. Please try again later."
fromKubernetes — message contains "exceeded quota" and "cpu" -> InsufficientComputingResource("CPU"); "memory" -> ("memory"); "gpu" -> ("GPU")
fromKubernetes — "exceeded quota" but none of cpu/memory/gpu -> InternalError(e.getMessage)
fromKubernetes — message without "exceeded quota" -> InternalError(e.getMessage)
fromKubernetes — null message -> InternalError (the Option(e.getMessage).getOrElse("") path)
- Case-insensitivity:
"Exceeded Quota: CPU limit" classifies as CPU (message is lower-cased before matching)
Task Type
Task Summary
computing-unit-managing-service/src/main/scala/org/apache/texera/service/util/ComputingUnitManagingServiceException.scala(0% coverage) defines a sealed exception hierarchy plusfromKubernetes, which classifies aKubernetesClientExceptioninto a typed exception. Pure logic, no DB — a plainAnyFlatSpeccovers it.Behavior to cover
InsufficientComputingResource("CPU").getMessage=="Insufficient CPU available in the server. Please decrease the requested amount or try again later."InsufficientComputingUnitQuota(3).getMessage=="You may only have 3 computing-unit(s) running at the same time"InternalError().getMessage== the default"The server encountered an internal error while processing your request. Please try again later."fromKubernetes— message contains"exceeded quota"and"cpu"->InsufficientComputingResource("CPU");"memory"->("memory");"gpu"->("GPU")fromKubernetes—"exceeded quota"but none of cpu/memory/gpu ->InternalError(e.getMessage)fromKubernetes— message without"exceeded quota"->InternalError(e.getMessage)fromKubernetes—nullmessage ->InternalError(theOption(e.getMessage).getOrElse("")path)"Exceeded Quota: CPU limit"classifies as CPU (message is lower-cased before matching)Task Type