[WORKER] Reboot Windows testers after every run of run_rostests

This works by putting the new `buildbot_start.cmd` into Scheduled Tasks (run on logon).
It launches the BuildBot worker and waits for it to finish, then reboots the Windows VM.

The BuildBot worker is reconfigured to watch the `shutdown.stamp` file in the basedir, and ask the Buildmaster for a graceful shutdown of the worker if that file's timestamp has changed.
This works via BuildBot's allow_shutdown Worker config option.

All of this together should gracefully reboot the Windows VM after every test, even when multiple tests are queued and without causing any BuildBot exceptions (which always happen on unexpected shutdowns).

Dedicated to Timo, who asked me about this for months and also found the allow_shutdown option :)
This commit is contained in:
Colin Finck 2022-07-13 18:29:08 +02:00
parent ce63a5e757
commit b7f59ec24d
No known key found for this signature in database
GPG Key ID: 1BA74E70456BA1A9
3 changed files with 12 additions and 1 deletions

View File

@ -32,7 +32,7 @@ keepalive = 600
umask = 0o22
maxdelay = 300
numcpus = None
allow_shutdown = None
allow_shutdown = 'file'
maxretries = None
s = Worker(buildmaster_host, port, workername, passwd, basedir,

View File

@ -0,0 +1,7 @@
@echo off
:: Start the worker, which is configured with allow_shutdown = 'file'
:: Once a single test is done, it will initiate a graceful shutdown of the worker.
start /wait C:\Python27\Scripts\buildbot-worker.exe start C:\buildbot_config\worker
:: Reboot for a clean next test run
shutdown -r -t 0

View File

@ -12,3 +12,7 @@ cd $WORKDIR
mv ${ROSAUTOTEST_DIR}/rosautotest.exe . || exit $?
cp $SOURCEDIR/../rosautotest.ini . || exit $?
./rosautotest.exe /c "Build $1" /w
# Initiate a graceful shutdown of the BuildBot worker, which in turn
# initiates a graceful reboot of the Windows VM.
touch $SOURCEDIR/../../shutdown.stamp