Enable overcommit_memory in test server VMs

Enable memory overcommit in server VMs to fix an allocation error when
using static binaries that have been compiled with a recent golang
toolchain (>= 1.11).

Story: 2006346
Task: 36103

Change-Id: I1e5979b4e49492c9a84f936681214deac556d856
This commit is contained in:
Gregory Thiemonge 2019-08-06 17:25:42 +02:00
parent 3c941b8117
commit f72a886031
1 changed files with 11 additions and 0 deletions

View File

@ -805,6 +805,17 @@ class LoadBalancerBaseTestWithCompute(LoadBalancerBaseTest):
if proc.returncode != 0:
raise exceptions.CommandFailed(proc.returncode, cmd,
stdout, stderr)
# Enabling memory overcommit allows to run golang static binaries
# compiled with a recent golang toolchain (>=1.11). Those binaries
# allocate a large amount of virtual memory at init time, and this
# allocation fails in tempest's nano flavor (64MB of RAM)
# (golang issue reported in https://github.com/golang/go/issues/28114,
# follow-up: https://github.com/golang/go/issues/28081)
# TODO(gthiemonge): Remove this call when golang issue is resolved.
linux_client.exec_command('sudo sh -c "echo 1 > '
'/proc/sys/vm/overcommit_memory"')
linux_client.exec_command('sudo screen -d -m {0} -port 80 '
'-id {1}'.format(dest_file, start_id))
linux_client.exec_command('sudo screen -d -m {0} -port 81 '