Last active
April 14, 2021 06:37
-
-
Save wilbowma/f6d3eeb1a49aa88aed1b51f7897c1c51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#lang racket | |
;; Run like: racket -t meow.rkt; pgrep -a racket | |
;; Welcome to Racket v8.0.0.11 [cs]. | |
(require | |
racket/engine | |
rackunit) | |
(define exe-path (find-executable-path "racket")) | |
(define (doit) | |
(parameterize ([current-subprocess-custodian-mode 'kill]) | |
(let ([e (engine (lambda (_) | |
(system*/exit-code | |
exe-path | |
"-e" | |
"((lambda (x) (x x)) (lambda (x) (x x)))")))]) | |
(if (engine-run 1000 e) | |
(void) | |
(begin | |
(displayln "Timed out")))))) | |
;; When uncommented, this process terminates when "meow.rkt" terminates. | |
#;(doit) | |
;; When uncommented, this process terminates does NOT terminate the subprocess when "meow.rkt" terminates. | |
(test-case "" (doit)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment