Add cgroup v2 support for memory limit (#18905)

This commit is contained in:
Anis Eleuch
2024-01-30 20:13:27 +01:00
committed by GitHub
parent 7ffc162ea8
commit a669946357
4 changed files with 36 additions and 20 deletions

View File

@@ -21,7 +21,7 @@ import "testing"
// Tests - bytePool functionality.
func TestBytePool(t *testing.T) {
size := 4
size := uint64(4)
width := 1024
capWidth := 2048
@@ -49,7 +49,7 @@ func TestBytePool(t *testing.T) {
bufPool.Put(b)
// Fill the pool beyond the capped pool size.
for i := 0; i < size*2; i++ {
for i := uint64(0); i < size*2; i++ {
bufPool.Put(make([]byte, bufPool.w))
}
@@ -67,7 +67,7 @@ func TestBytePool(t *testing.T) {
close(bufPool.c)
// Check the size of the pool.
if len(bufPool.c) != size {
if uint64(len(bufPool.c)) != size {
t.Fatalf("bytepool size invalid: got %v want %v", len(bufPool.c), size)
}