Detect that we are running in docker-on-mac and automatically reduce timer frequency due to expensive
calls to sample time. This might reduce timeout accuracy from 1ms to 10ms, but that is fine for development.
docker-on-mac will never be supported as production environment.
@@ -117,11 +117,21 @@ add_valgrind_suppressions_file() {
fi
}
+optionally_reduce_base_frequency() {
+ os_release=`uname -r`
+ if [[ "$os_release" == *linuxkit* ]]; then
+ export VESPA_TIMER_HZ=100
+ echo "Running docker on macos. Reducing base frequency from 1000hz to 100hz due to high cost of sampling time. This will reduce timeout accuracy. VESPA_TIMER_HZ=$VESPA_TIMER_HZ"
+ fi
+}
+
populate_environment
export LD_LIBRARY_PATH=$VESPA_HOME/lib64
export MALLOC_ARENA_MAX=1
+optionally_reduce_base_frequency
+
# Prefer newer gdb and pstack
prepend_path /opt/rh/gcc-toolset-11/root/usr/bin
