#lang scheme/base
(require "../test-base.ss")
(require scheme/class)
(define (make-postgresql8-tests snooze)
(test-suite "postgresql8 tests"
(test-case "parallel connections"
(let ([thread-exn #f])
(apply
sync
(for/list ([i (in-range 100)])
(thread (lambda ()
(with-handlers ([(lambda _ #t) (lambda (exn) (set! thread-exn exn))])
(or thread-exn (send snooze call-with-connection (cut sleep 1) #f)))))))
(sleep 5)
(check-pred exn:fail:snooze:connection-count? thread-exn)))))
(provide make-postgresql8-tests)