Commits

Anonymous committed 0743543

made tests timeout to reproduce what we saw with salmonalla

  • Participants
  • Parent commits b39c945

Comments (0)

Files changed (2)

       (lambda (temp-file _)
         (stream-file temp-file sendfile))))
  
-   (test-group "sendfile main interface"
-               (test "sendfile" mb-checksum (stream-mb-buffer)))
+   ;; (test-group "sendfile main interface"
+   ;;             (test "sendfile" mb-checksum (stream-mb-buffer)))
 
-   (test-group "forcing implementation"
+   ;; (test-group "forcing implementation"
                
-               (parameterize ((force-implementation 'read-write))
-                 (test "read-write" mb-checksum (stream-mb-buffer)))
+   ;;             (parameterize ((force-implementation 'read-write))
+   ;;               (test "read-write" mb-checksum (stream-mb-buffer)))
 
-               (if sendfile-available
-                   (parameterize ((force-implementation 'sendfile))
-                     (test "sendfile(2)" mb-checksum (stream-mb-buffer))))
+   ;;             (if sendfile-available
+   ;;                 (parameterize ((force-implementation 'sendfile))
+   ;;                   (test "sendfile(2)" mb-checksum (stream-mb-buffer))))
 
-               (if mmap-available
-                   (parameterize ((force-implementation 'mmapped))
-                     (test "mmap(2)" mb-checksum (stream-mb-buffer))))
+   ;;             (if mmap-available
+   ;;                 (parameterize ((force-implementation 'mmapped))
+   ;;                   (test "mmap(2)" mb-checksum (stream-mb-buffer))))
 
-               (parameterize ((force-implementation 'read-write-port))
-                 (test "read-write-port" mb-checksum (stream-mb-buffer))))
+   ;;             (parameterize ((force-implementation 'read-write-port))
+   ;;               (test "read-write-port" mb-checksum (stream-mb-buffer))))
 
 
-   (test-group "read-write variations"
+   ;; (test-group "read-write variations"
                
-               (call-with-temporary-file/checksum
-                (generate-buffer (mebibytes 1))
-                (lambda (temp-file expected-checksum)
-                  (test "ports only"
-                        expected-checksum
-                        (call-with-connection-to-server
-                         (lambda (server-in server-out)
-                           (write-content-size server-out (mebibytes 1))
-                           (call-with-input-file temp-file
-                             (lambda (file-in)
-                               (sendfile file-in server-out)))
-                           (read-checksum server-in)))))))
+   ;;             (call-with-temporary-file/checksum
+   ;;              (generate-buffer (mebibytes 1))
+   ;;              (lambda (temp-file expected-checksum)
+   ;;                (test "ports only"
+   ;;                      expected-checksum
+   ;;                      (call-with-connection-to-server
+   ;;                       (lambda (server-in server-out)
+   ;;                         (write-content-size server-out (mebibytes 1))
+   ;;                         (call-with-input-file temp-file
+   ;;                           (lambda (file-in)
+   ;;                             (sendfile file-in server-out)))
+   ;;                         (read-checksum server-in)))))))
 
 
    (test-group "content chunking"
             (let ((input (open-input-string buffer)))
               (write-content-size server-out -1)
               (proc input server-out)
-              (close-output-port server-out)
+              (flush-output server-out)
               (read-checksum server-in)))))
 
         (define-syntax test-chunking
         
         (test-chunking "read-write-port")))
 
-;   (test-group "bugs"               
-;               (call-with-buffer/checksum
-;                (kibibytes 1)
-;                (lambda (buffer checksum)
-;                  (test "custom input port without fd [bug #542]"
-;                        checksum
-;                        (call-with-connection-to-server
-;                         (lambda (server-in server-out)
-;                           (write-content-size server-out (kibibytes 1))
-;                           (sendfile (open-input-string buffer) server-out)
-;                           (read-checksum server-in))))))
-;   
-;    
-;               (call-with-temporary-file/checksum
-;                (generate-buffer (mebibytes 2))
-;                (lambda (temp-file expected-checksum)
-;                  (test "send files > 1 mebibyte"
-;                        expected-checksum
-;                        (stream-file temp-file sendfile)))))))
-))
+  (test-group "bugs"               
+              (call-with-buffer/checksum
+               (kibibytes 1)
+               (lambda (buffer checksum)
+                 (test "custom input port without fd [bug #542]"
+                       checksum
+                       (call-with-connection-to-server
+                        (lambda (server-in server-out)
+                          (write-content-size server-out (kibibytes 1))
+                          (sendfile (open-input-string buffer) server-out)
+                          (flush-output server-out)
+                          (read-checksum server-in))))))
+  
+   
+              (call-with-temporary-file/checksum
+               (generate-buffer (mebibytes 2))
+               (lambda (temp-file expected-checksum)
+                 (test "send files > 1 mebibyte"
+                       expected-checksum
+                       (stream-file temp-file sendfile)))))))
 
 
 (unless (zero? (test-failure-count)) (exit 1))

tests/test-helper.scm

   (handle-exceptions exn
       (begin (display "Error" output)
              (display (get-condition-property exn 'exn 'msg "Unknown") output)
-             (newline output))
+             (newline output)
+             (flush-output output))
     (let* ((header (read-line input)))
       (unless (eof-object? header)
         (let* ((bytes-following (string->number header))
 
 ;; access the running server
 (define (call-with-connection-to-server proc)
-  (parameterize ((tcp-read-timeout 30000))
+  (parameterize ((tcp-read-timeout 60000))
     (receive (input output) (tcp-connect "localhost" (server-port))
       (let ((result (proc input output)))
         (close-input-port input)