498b235461
Build and test / Build and test AMD64 Ubuntu 22.04 (push) Failing after 0s
Publish Builder / amazonlinux2023 (push) Failing after 1s
Build and test / UT for Go (push) Has been skipped
Publish KRTE Images / KRTE (push) Failing after 1s
Build and test / Integration Test (push) Has been skipped
Build and test / Upload Code Coverage (push) Has been skipped
Publish Builder / rockylinux9 (push) Failing after 1s
Publish Builder / ubuntu22.04 (push) Failing after 0s
Publish Builder / ubuntu24.04 (push) Failing after 0s
Publish Gpu Builder / publish-gpu-builder (push) Failing after 1s
Publish Test Images / PyTest (push) Failing after 0s
Build and test / UT for Cpp (push) Has been cancelled
44 lines
1.0 KiB
Go
44 lines
1.0 KiB
Go
package ratelimitutil
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/milvus-io/milvus-proto/go-api/v3/commonpb"
|
|
)
|
|
|
|
func TestGetQuotaErrorString(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
args commonpb.ErrorCode
|
|
want string
|
|
}{
|
|
{
|
|
name: "Test ErrorCode_ForceDeny",
|
|
args: commonpb.ErrorCode_ForceDeny,
|
|
want: "access has been disabled by the administrator",
|
|
},
|
|
{
|
|
name: "Test ErrorCode_MemoryQuotaExhausted",
|
|
args: commonpb.ErrorCode_MemoryQuotaExhausted,
|
|
want: "memory quota exceeded, please allocate more resources",
|
|
},
|
|
{
|
|
name: "Test ErrorCode_DiskQuotaExhausted",
|
|
args: commonpb.ErrorCode_DiskQuotaExhausted,
|
|
want: "disk quota exceeded, please allocate more resources",
|
|
},
|
|
{
|
|
name: "Test ErrorCode_TimeTickLongDelay",
|
|
args: commonpb.ErrorCode_TimeTickLongDelay,
|
|
want: "time tick long delay",
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
if got := GetQuotaErrorString(tt.args); got != tt.want {
|
|
t.Errorf("GetQuotaErrorString() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|