Apply scaling reserved RAM to large runners only

This commit is contained in:
Henry Mercer 2023-07-21 17:35:34 +01:00
parent 18ae9813bf
commit fda93d8ef5
6 changed files with 16 additions and 16 deletions

View file

@ -25,21 +25,21 @@ const GET_MEMORY_FLAG_TESTS = [
totalMemoryMb: 8 * 1024,
platform: "linux",
expectedMemoryValue: 7 * 1024,
expectedMemoryValueWithScaling: 7004, // Math.floor(1024 * (8*0.98 - 1))
expectedMemoryValueWithScaling: 7 * 1024,
},
{
input: undefined,
totalMemoryMb: 8 * 1024,
platform: "win32",
expectedMemoryValue: 6.5 * 1024,
expectedMemoryValueWithScaling: 6492, // Math.floor(1024 * (8*0.98 - 1.5))
expectedMemoryValueWithScaling: 6.5 * 1024,
},
{
input: "",
totalMemoryMb: 8 * 1024,
platform: "linux",
expectedMemoryValue: 7 * 1024,
expectedMemoryValueWithScaling: 7004, // Math.floor(1024 * (8*0.98 - 1))
expectedMemoryValueWithScaling: 7 * 1024,
},
{
input: "512",
@ -53,14 +53,14 @@ const GET_MEMORY_FLAG_TESTS = [
totalMemoryMb: 64 * 1024,
platform: "linux",
expectedMemoryValue: 63 * 1024,
expectedMemoryValueWithScaling: 63201, // Math.floor(1024 * (64*0.98 - 1))
expectedMemoryValueWithScaling: 63078, // Math.floor(1024 * (64 - 1 - 0.025 * (64 - 8)))
},
{
input: undefined,
totalMemoryMb: 64 * 1024,
platform: "win32",
expectedMemoryValue: 62.5 * 1024,
expectedMemoryValueWithScaling: 62689, // Math.floor(1024 * (64*0.98 - 1.5))
expectedMemoryValueWithScaling: 62566, // Math.floor(1024 * (64 - 1.5 - 0.025 * (64 - 8)))
},
];