Skip to content

Commit

Permalink
Check for memory requirements when running regressions
Browse files Browse the repository at this point in the history
Lowered the default amount of memory allocated for our Vagrant VM
so that it can be booted on systems with not a lot of RAM. In turn,
also introduced memory-limit flag to our regressions, allowing
for larger regressions to be run only if the required amount
of memory is present.

Closes #175
  • Loading branch information
zvonimir committed May 12, 2016
1 parent db22329 commit 894e36e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Vagrant.configure(2) do |config|
project_name = File.dirname(__FILE__).split("/").last

config.vm.provider "virtualbox" do |vb|
vb.memory = 6144 # set VM memory to 6GB
# vb.memory = 2048 # control VM memory (set it to 2GB)
vb.customize ["modifyvm", :id, "--usb", "off"]
vb.customize ["modifyvm", :id, "--usbehci", "off"]
end
Expand All @@ -13,8 +13,8 @@ Vagrant.configure(2) do |config|
ubuntu_config.vm.box = "minimal/trusty64"
end

#This provision, 'fix-no-tty', gets rid of an error during build
#which says "==> default: stdin: is not a tty"
# This provision, 'fix-no-tty', gets rid of an error during build
# which says "==> default: stdin: is not a tty"
config.vm.provision "fix-no-tty", type: "shell" do |s|
s.privileged = false
s.inline = "sudo sed -i '/tty/!s/mesg n/tty -s \\&\\& mesg n/' /root/.profile"
Expand Down
2 changes: 1 addition & 1 deletion bin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ CONFIGURE_INSTALL_PREFIX=
CMAKE_INSTALL_PREFIX=

# Partial list of dependnecies; the rest are added depending on the platform
DEPENDENCIES="git cmake python-yaml unzip wget"
DEPENDENCIES="git cmake python-yaml python-psutil unzip wget"

################################################################################
#
Expand Down
1 change: 1 addition & 0 deletions test/ntdrivers/config.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
skip: ok
time-limit: 1600
memory-limit: 2000
1 change: 1 addition & 0 deletions test/pthread/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
skip: ok
verifiers: [corral]
memory: [no-reuse-impls]
time-limit: 300
Expand Down
7 changes: 6 additions & 1 deletion test/regtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import signal
import logging
import yaml
import psutil
import argparse
from os import path
import subprocess
Expand All @@ -15,7 +16,7 @@
import time
import sys

OVERRIDE_FIELDS = ['verifiers', 'memory', 'time-limit', 'skip']
OVERRIDE_FIELDS = ['verifiers', 'memory', 'time-limit', 'memory-limit', 'skip']
APPEND_FIELDS = ['flags']

def bold(text):
Expand Down Expand Up @@ -143,6 +144,7 @@ def main():
"""
t0 = time.time()
num_cpus = multiprocessing.cpu_count()
mem_total = psutil.virtual_memory().total / (1024 * 1024)

# configure the CLI
parser = argparse.ArgumentParser()
Expand Down Expand Up @@ -191,6 +193,9 @@ def main():
# get the meta data for this test
meta = metadata(test)

if meta['memory-limit'] > mem_total:
continue

if meta['skip'] == True:
continue

Expand Down

0 comments on commit 894e36e

Please sign in to comment.