tests: dicod: Bail out if we cannot connect within 20 seconds.
* gnu/tests/dict.scm (run-dicod-test)["connect inside"]: Bail out after 20 seconds of failure to connect.
This commit is contained in:
		
							parent
							
								
									3d3c565008
								
							
						
					
					
						commit
						cbe0af11b2
					
				
					 1 changed files with 5 additions and 4 deletions
				
			
		| 
						 | 
					@ -97,15 +97,16 @@
 | 
				
			||||||
               '(begin
 | 
					               '(begin
 | 
				
			||||||
                  (use-modules (ice-9 rdelim))
 | 
					                  (use-modules (ice-9 rdelim))
 | 
				
			||||||
                  (let ((sock (socket PF_INET SOCK_STREAM 0)))
 | 
					                  (let ((sock (socket PF_INET SOCK_STREAM 0)))
 | 
				
			||||||
                    (let loop ()
 | 
					                    (let loop ((i 0))
 | 
				
			||||||
                      (pk 'try)
 | 
					                      (pk 'try i)
 | 
				
			||||||
                      (catch 'system-error
 | 
					                      (catch 'system-error
 | 
				
			||||||
                        (lambda ()
 | 
					                        (lambda ()
 | 
				
			||||||
                          (connect sock AF_INET INADDR_LOOPBACK 2628))
 | 
					                          (connect sock AF_INET INADDR_LOOPBACK 2628))
 | 
				
			||||||
                        (lambda args
 | 
					                        (lambda args
 | 
				
			||||||
                          (pk 'connection-error args)
 | 
					                          (pk 'connection-error args)
 | 
				
			||||||
 | 
					                          (when (< i 20)
 | 
				
			||||||
                            (sleep 1)
 | 
					                            (sleep 1)
 | 
				
			||||||
                          (loop))))
 | 
					                            (loop (+ 1 i))))))
 | 
				
			||||||
                    (read-line sock 'concat)))
 | 
					                    (read-line sock 'concat)))
 | 
				
			||||||
               marionette))
 | 
					               marionette))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue