diff options
| -rw-r--r-- | azure-pipelines.yml | 3 | ||||
| -rw-r--r-- | snekbox/nsjail.py | 7 | 
2 files changed, 7 insertions, 3 deletions
| diff --git a/azure-pipelines.yml b/azure-pipelines.yml index d22ba40..98d64bf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -43,6 +43,9 @@ jobs:        testResultsFiles: '**/test-lint.xml'        testRunTitle: 'Lint Results' +  - script: sudo swapoff -a +    displayName: 'Disable swap memory' +    - script: |        docker exec snekbox_test /bin/ash -c \          'pipenv run coverage run -m xmlrunner' diff --git a/snekbox/nsjail.py b/snekbox/nsjail.py index b79ec9e..1ca3762 100644 --- a/snekbox/nsjail.py +++ b/snekbox/nsjail.py @@ -76,9 +76,10 @@ class NsJail:              with (mem / "memory.memsw.limit_in_bytes").open("w", encoding="utf=8") as f:                  f.write(str(MEM_MAX))          except PermissionError: -            log.info( -                "Failed to disable memory swapping in the cgroup. " -                "This is probably because CONFIG_MEMCG_SWAP_ENABLED is unset." +            log.warning( +                "Failed to set the memory swap limit for the cgroup. " +                "This is probably because CONFIG_MEMCG_SWAP or CONFIG_MEMCG_SWAP_ENABLED is unset. " +                "Please ensure swap memory is disabled on the system."              )      @staticmethod | 
