Megatest

Diff
Login

Differences From Artifact [89bdcd6c8f]:

To Artifact [c1c08ee586]:


435
436
437
438
439
440
441

442
443
444
445
446
447
448
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449







+







                                 overwritten by values set in config files.
  -server -|hostname      : start the server (reduces contention on megatest.db), use
                            - to automatically figure out hostname
  -adjutant C,M           : start the server/adjutant with allocated cores C and Mem M (Gig), 
                            use 0,0 to auto use full machine
  -transport http|rpc     : use http or rpc for transport (default is http) 
  -log logfile            : send stdout and stderr to logfile
  -autolog logfilebase    : appends pid and host to logfilebase for logfile
  -list-servers           : list the servers 
  -kill-servers           : kill all servers
  -repl                   : start a repl (useful for extending megatest)
  -load file.scm          : load and run file.scm
  -mark-incompletes       : find and mark incomplete tests
  -ping run-id|host:port  : ping server, exit with 0 if found
  -debug N|N,M,O...       : enable debug 0-N or N and M and O ...
628
629
630
631
632
633
634

635
636
637
638
639
640
641
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643







+







     			"-var"
     			"-dumpmode"
     			"-run-id"
     			"-ping"
     			"-refdb2dat"
     			"-o"
     			"-log"
			"-autolog"
			"-sync-log"
     			"-since"
     			"-fields"
     			"-recover-test" ;; run-id,test-id - used internally to recover a test stuck in RUNNING state
     			"-sort"
     			"-target-db"
     			"-source-db"
782
783
784
785
786
787
788
789


790
791
792
793
794


795
796
797
798





799
800
801
802
803
804
805
784
785
786
787
788
789
790

791
792
793
794
795
796
797
798
799




800
801
802
803
804
805
806
807
808
809
810
811







-
+
+





+
+
-
-
-
-
+
+
+
+
+







;;      	 (list? n))
;;          (member *verbosity* n))))

     ;; this segment will run launch:setup only if -log is not set. This is fairly safe as servers are not
     ;; manually started and thus should never be started in a non-megatest area. Thus no need to handle situation
     ;; where (launch:setup) returns #f?
     ;;
     (if (or (args:get-arg "-log")#;(args:get-arg "-server")) ;; redirect the log always when a server
     (if (or (args:get-arg "-log") ;;(args:get-arg "-server") ;; redirect the log always when a server
	     (args:get-arg "-autolog"))
         (handle-exceptions
     	exn
     	(begin
     	  (print "ERROR: Failed to switch to log output. " ((condition-property-accessor 'exn 'message) exn) ", exn=" exn)
     	  )
        (let* ((tl   (or (args:get-arg "-log")
			 (args:get-arg "-autolog") ;; autolog provides the basename .../logs/something- for the logfile
           (let* ((tl   (or (args:get-arg "-log")(launch:setup)))   ;; run launch:setup if -server, ensure we do NOT run launch:setup if -log specified
     	     (logf (or (args:get-arg "-log") ;; use -log unless we are a server, then craft a logfile name
     		       (conc tl "/logs/server-" (current-process-id) "-" (get-host-name) ".log")))
     	     (oup  (open-logfile logf)))
			 (launch:setup)))   ;; run launch:setup if -server, ensure we do NOT run launch:setup if -log specified
     	       (logf (or (args:get-arg "-log") ;; use -log unless we are a server, then craft a logfile name
			 (conc tl (current-process-id)"-"(get-host-name)".log")
     			 (conc tl "/logs/server-" (current-process-id) "-" (get-host-name) ".log")))
     	       (oup  (open-logfile logf)))
     	(if (not (args:get-arg "-log"))
     	    (hash-table-set! args:arg-hash "-log" logf)) ;; fake out future queries of -log
     	(debug:print-info 0 *default-log-port* "Sending log output to " logf)
     	(set! *default-log-port* oup))))
     
     (if (or (args:get-arg "-h")
     	(args:get-arg "-help")