mirror of
https://github.com/MariaDB/server.git
synced 2025-01-28 01:34:17 +01:00
eb29190398
The 'if (!m_abort) break' condition was inverted by accident. Constrain the test case to environments where there is cgroupv2 runtime environment which is the same case that will pass a memory pressure initialization. Remove the explicit garbage_collection trigger as it hides the abnormal termination error on the event loop for memory pressure. This also means there is no support in non-cgroupv2 environments (possibly some container environments). As the trigger to memory pressure is via a different thread we need to wait until a "[mM]emory pressure" log message is there to know it has succeeded or failed. Thanks Kristian Nielsen for noticing and review.
28 lines
501 B
PHP
28 lines
501 B
PHP
--source include/linux.inc
|
|
--error 0,1
|
|
perl;
|
|
use strict;
|
|
use warnings;
|
|
use File::Spec;
|
|
|
|
# Read the cgroup file
|
|
my $cgroup_file = '/proc/self/cgroup';
|
|
open my $fh, '<', $cgroup_file or exit 1;
|
|
my $line = <$fh>;
|
|
close $fh;
|
|
|
|
# Process the cgroup file content
|
|
$line =~ s/^0:://;
|
|
chomp($line);
|
|
|
|
# Construct the path
|
|
my $path = File::Spec->catdir('/sys/fs/cgroup', $line, 'memory.pressure');
|
|
|
|
# Check if the file is writable exists
|
|
exit 0 if -w $path;
|
|
exit 1;
|
|
EOF
|
|
if ($errno)
|
|
{
|
|
--skip Requires cgroupv2
|
|
}
|