Commits
Tarun Sukhani authored a4648ae6c0a
fix(testrunner): collapse post-test wait from 1-2min to ~1s
Two coupled fixes for the long pause after play auto-test prints all test
results:
1. FirePhoque: add System.exit(0) at end of main(). HtmlUnit's WebClient
leaks non-daemon threads (Apache HttpClient connection-pool keep-alive
evictor, Rhino setTimeout ScheduledExecutorService) that block JVM exit
for ~60-120s after main() returns even with close(). Process is one-shot
and autotest.py reads pass/fail from test-result/result.{passed,failed}
markers, not from the FirePhoque exit code, so a hard exit is safe and
bypasses the slow WebClient teardown.
2. autotest.py: reorder result-print before /@kill, lower urlopen timeout
to 0.5s, capture Play subprocess stderr.
- The /@kill server-side handler in PlayStatusPlugin.rawInvocation calls
System.exit(0) within milliseconds but the HTTP response is never
written (System.exit aborts the request handler). urlopen would
otherwise block on the open socket until plugin-shutdown finishes
(HikariCP/c3p0/JPA/Hibernate close + Netty event-loop drain,
30-90s on heavy apps).
- timeout=0.5 is safe: only the read wait is bounded; connect+send is
synchronous and well under 500ms on localhost, so /@kill is
guaranteed to reach the server.
- stderr=subprocess.STDOUT redirects Play's shutdown logs to the same
system.out file as stdout, so the user's terminal stays clean after
the prompt returns instead of dripping shutdown traces from the
orphaned Play process.
Net effect on jclaw measurements:
pre-fix: 32-90s wait between last test and shell prompt return
post-fix: ~1s (the 0.5s urlopen timeout + Python interpreter exit)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>