Skip to content

Commit b7f59ec

Browse files
committed
[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 :)
1 parent ce63a5e commit b7f59ec

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

worker/buildbot.tac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ keepalive = 600
3232
umask = 0o22
3333
maxdelay = 300
3434
numcpus = None
35-
allow_shutdown = None
35+
allow_shutdown = 'file'
3636
maxretries = None
3737

3838
s = Worker(buildmaster_host, port, workername, passwd, basedir,

worker/buildbot_start.cmd

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@echo off
2+
:: Start the worker, which is configured with allow_shutdown = 'file'
3+
:: Once a single test is done, it will initiate a graceful shutdown of the worker.
4+
start /wait C:\Python27\Scripts\buildbot-worker.exe start C:\buildbot_config\worker
5+
6+
:: Reboot for a clean next test run
7+
shutdown -r -t 0

worker/run_rostests

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ cd $WORKDIR
1212
mv ${ROSAUTOTEST_DIR}/rosautotest.exe . || exit $?
1313
cp $SOURCEDIR/../rosautotest.ini . || exit $?
1414
./rosautotest.exe /c "Build $1" /w
15+
16+
# Initiate a graceful shutdown of the BuildBot worker, which in turn
17+
# initiates a graceful reboot of the Windows VM.
18+
touch $SOURCEDIR/../../shutdown.stamp

0 commit comments

Comments
 (0)