attempt to reset hardware before each test (#859)

* Trims SSD drives, flushes cache before each performance test. Unfortunately these are still incomplete -- need to use real hardware machines for all these to take effect.
* A bit more output in PR updater
pull/860/head
Yuri Astrakhan 2020-05-07 15:33:28 -04:00 zatwierdzone przez GitHub
rodzic 9f9facc8c6
commit 632a33ed05
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 20 dodań i 1 usunięć

Wyświetl plik

@ -88,6 +88,7 @@ jobs:
exit
else
echo "$PR_COUNT pull requests have been updated in the last $IGNORE_PRS_OLDER_THAN minutes"
echo "$PULL_REQUESTS" | jq -r 'keys|.[]|" * " + .'
fi

Wyświetl plik

@ -109,7 +109,7 @@ jobs:
with:
path: perf_cache
# If profiling result cache has incompatible format, increase this "v" number
key: "v10-${{ steps.calc.outputs.hash }}-${{ env.TEST_DATA_URL }}"
key: "v11-${{ steps.calc.outputs.hash }}-${{ env.TEST_DATA_URL }}"
- name: Load test data into DB and run performance test
id: main
@ -147,6 +147,24 @@ jobs:
r\t%r\tNumber of socket messages received by the process.
s\t%s\tNumber of socket messages sent by the process.
"
# reset system for a more predictable results (hopefully)
sudo -- bash -c "
set -euo pipefail
echo 'Hardware reset $1 ...'
# Run the TRIM command (for SSDs)
/sbin/fstrim --all
# Run sync to minimize the number of dirty objects on the system
/bin/sync
# Give sync a little bit of time to finish. See https://linux.die.net/man/8/sync
sleep 5
# Free slab objects and pagecache
echo 3 > /proc/sys/vm/drop_caches
# Request compaction to reduce memory fragmentation
echo 1 > /proc/sys/vm/compact_memory
echo 'Hardware reset $1 done'
"
# Must use full path to get the full-featured version of time
# profile-*.tsv filenames are parsed using ${file:8:-4} below
/usr/bin/time --format "$TIME_FORMAT" --output "${PROFILE_DIR}/profile-${1}.tsv" "${@:2}"