Unverified Commit d2cd24fe authored by github-actions[bot]'s avatar github-actions[bot] Committed by GitHub
Browse files

Merge master into staging-next

parents 1b60238a bf887f0d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ import ../make-test-python.nix ({...}: {
        enable = true;
        master = "master:7077";
      };
      virtualisation.memorySize = 2048;
    };
    master = { config, pkgs, ... }: {
      services.spark.master = {
+36 −19
Original line number Diff line number Diff line
@@ -3,35 +3,52 @@ import ./make-test-python.nix ({ pkgs, ... }:
{
  name = "systemd-oomd";

  # This test is a simplified version of systemd's testsuite-55.
  # https://github.com/systemd/systemd/blob/v251/test/units/testsuite-55.sh
  nodes.machine = { pkgs, ... }: {
    systemd.oomd.extraConfig.DefaultMemoryPressureDurationSec = "1s"; # makes the test faster
    # Kill cgroups when more than 1% pressure is encountered
    systemd.slices."-".sliceConfig = {
    # Limit VM resource usage.
    virtualisation.memorySize = 1024;
    systemd.oomd.extraConfig.DefaultMemoryPressureDurationSec = "1s";

    systemd.slices.workload = {
      description = "Test slice for memory pressure kills";
      sliceConfig = {
        MemoryAccounting = true;
        ManagedOOMMemoryPressure = "kill";
      ManagedOOMMemoryPressureLimit = "1%";
        ManagedOOMMemoryPressureLimit = "10%";
      };
    # A service to bring the system under memory pressure
    systemd.services.testservice = {
      serviceConfig.ExecStart = "${pkgs.coreutils}/bin/tail /dev/zero";
    };
    # Do not kill the backdoor
    systemd.services.backdoor.serviceConfig.ManagedOOMMemoryPressure = "auto";

    virtualisation.memorySize = 1024;
    systemd.services.testbloat = {
      description = "Create a lot of memory pressure";
      serviceConfig = {
        Slice = "workload.slice";
        MemoryHigh = "5M";
        ExecStart = "${pkgs.coreutils}/bin/tail /dev/zero";
      };
    };

    systemd.services.testchill = {
      description = "No memory pressure";
      serviceConfig = {
        Slice = "workload.slice";
        MemoryHigh = "3M";
        ExecStart = "${pkgs.coreutils}/bin/sleep infinity";
      };
    };
  };

  testScript = ''
    # Start the system
    # Start the system.
    machine.wait_for_unit("multi-user.target")
    machine.succeed("oomctl")

    # Bring the system into memory pressure
    machine.succeed("echo 0 > /proc/sys/vm/panic_on_oom")  # NixOS tests kill the VM when the OOM killer is invoked - override this
    machine.succeed("systemctl start testservice")
    machine.succeed("systemctl start testchill.service")
    with subtest("OOMd should kill the bad service"):
        machine.fail("systemctl start --wait testbloat.service")
        assert machine.get_unit_info("testbloat.service")["Result"] == "oom-kill"

    # Wait for oomd to kill something
    # Matches these lines:
    # systemd-oomd[508]: Killed /system.slice/systemd-udevd.service due to memory pressure for / being 3.26% > 1.00% for > 1s with reclaim activity
    machine.wait_until_succeeds("journalctl -b | grep -q 'due to memory pressure for'")
    with subtest("Service without memory pressure should be untouched"):
        machine.require_unit_state("testchill.service", "active")
  '';
})
+2 −2
Original line number Diff line number Diff line
{ stdenv, lib, fetchFromGitHub, xlibsWrapper, motif
{ stdenv, lib, fetchFromGitHub, motif, xorg
, withAudioTracking ? false, libpulseaudio, aubio }:

stdenv.mkDerivation {
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
  makeFlags = [ "DESTINATION=$(out)/bin/" ]
    ++ lib.optional withAudioTracking "WITH_TEMPO_TRACKER=1";

  buildInputs = [ xlibsWrapper motif ]
  buildInputs = [ motif xorg.libX11 xorg.libXext xorg.libXt ]
    ++ lib.optionals withAudioTracking [ libpulseaudio aubio ];

  meta = with lib; {
+2 −2
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@

python3.pkgs.buildPythonApplication rec {
  pname = "numberstation";
  version = "1.1.0";
  version = "1.2.0";

  format = "other";

@@ -23,7 +23,7 @@ python3.pkgs.buildPythonApplication rec {
    owner = "~martijnbraam";
    repo = "numberstation";
    rev = version;
    hash = "sha256-A6qwsbeNZXfSOZwHp19/4JQ8dZgjsK7Y2zho6vJXsGA=";
    hash = "sha256-e/KZrBnep5LbzgNnIoZlS5AMxhx4KlmdYDzdldMGVwg=";
  };

  postPatch = ''
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ python3.pkgs.buildPythonApplication rec {
    urwid
    urwid-readline
  ];
  format = "other";

  dontBuild = true;

Loading