mengw15 opened a new issue, #6325:
URL: https://github.com/apache/texera/issues/6325
### 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
- [ ] Refactor / Cleanup
- [ ] DevOps / Deployment / CI
- [x] Testing / QA
- [ ] Documentation
- [ ] Performance
- [ ] Other
--
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]