Megatest

Diff
Login

Differences From Artifact [33c7316880]:

To Artifact [9136bd0109]:


568
569
570
571
572
573
574
575

576
577
578
579
580
581
582
568
569
570
571
572
573
574

575
576
577
578
579
580
581
582







-
+







	    (for-each
	     (lambda (file)
	       (let* ((fullname (conc "logs/" file)))
		 (if (directory? fullname)
		     (debug:print-info 0 *default-log-port* fullname " in logs directory is a directory! Cannot rotate it, it is best to not put subdirectories in the logs dir.")
		     (handle-exceptions
		      exn
		      (debug:print-error 0 *default-log-port* "failed to remove " fullname ", exn=" exn)
		      (debug:print-info 0 *default-log-port* "failed to remove " fullname ", exn=" exn)
		      (delete-file* fullname)))))
	     files)
	    (debug:print-info 0 *default-log-port* "Deleted " (length files) " files from logs, keeping " max-allowed " files."))))))
  
;; Force a megatest cleanup-db if version is changed and skip-version-check not specified
;; Do NOT check if not on homehost!
;;
1313
1314
1315
1316
1317
1318
1319

1320
1321



1322
1323
1324
1325







1326
1327
1328


1329
1330
1331


1332
1333
1334

1335
1336
1337
1338
1339
1340
1341
1313
1314
1315
1316
1317
1318
1319
1320


1321
1322
1323
1324
1325


1326
1327
1328
1329
1330
1331
1332
1333


1334
1335



1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348







+
-
-
+
+
+


-
-
+
+
+
+
+
+
+

-
-
+
+
-
-
-
+
+



+







      rtestpatt)
     (else 
      (debug:print-info 0 *default-log-port* "using testpatt " args-testpatt " rtestpatt:" rtestpatt)
      args-testpatt))))



;; 
(define (common:false-on-exception thunk #!key (message #f))
  (handle-exceptions exn
(define (common:false-on-exception thunk #!key (message #f)(tries 1))
  (handle-exceptions
      exn
                     (begin
                       (if message
                           (debug:print-info 0 *default-log-port* message))
                       #f) (thunk) ))
          (debug:print-info 0 *default-log-port* message " exn=" exn))
      (if (> tries 1)
	  (begin
	    (thread-sleep! 1)
	    (common:false-on-exception thunk message: message tries: (- tries 1)))
	  #f))
    (thunk)))

(define (common:file-exists? path-string #!key (silent #f))
  ;; this avoids stack dumps in the case where 
(define (common:file-exists? path-string #!key (silent #f)(tries 1))
  ;; this avoids stack dumps in the case where NFS is slow or flakey

  ;;;; TODO: catch permission denied exceptions and emit appropriate warnings, eg:  system error while trying to access file: "/nfs/pdx/disks/icf_env_disk001/bjbarcla/gwa/issues/mtdev/randy-slow/reproduce/q...
  (common:false-on-exception (lambda () (file-exists? path-string))
  (common:false-on-exception
   (lambda ()(file-exists? path-string))
                             message: (if (not silent)
                                          (conc "Unable to access path: " path-string)
                                          #f)
   tries: tries
                             ))

(define (common:directory-exists? path-string)
  ;;;; TODO: catch permission denied exceptions and emit appropriate warnings, eg:  system error while trying to access file: "/nfs/pdx/disks/icf_env_disk001/bjbarcla/gwa/issues/mtdev/randy-slow/reproduce/q...
  (common:false-on-exception (lambda () (directory-exists? path-string))
                             message: (conc "Unable to access path: " path-string)
                             ))