Megatest

Diff
Login

Differences From Artifact [c02961cc89]:

To Artifact [96d2090959]:


97
98
99
100
101
102
103





104
105
106
107
108
109
110
111
112
113
114
115
116
117



118
119
120
121
122
123
124
125
126
127
128
129
130
131










132
133
134
135
136
137
138
(include "db_records.scm")

;; these come from processmod
;;
;; (define setenv set-environment-variable!)
;; (define unsetenv unset-environment-variable!)
;; (define getenv get-environment-variable)






(define *bdat* #f) ;; the one and only (someday) global?

(defstruct bdat
  (home                   (getenv "HOME"))
  (user                   (getenv "USER"))
  (watchdog               #f)
  (time-to-exit           #f)
  (task-db                #f)
  (target                 #f)
  (this-exe-fullpath      #f)
  (this-exe-dir           #f)
  (this-exe-name          #f)
  (orig-env               #f)



  ;; (server-loop-heart-beat (current-seconds))
  )

;; move all needed initialization into here
;; break it into pieces if need be later
;;
(define (make-and-init-bigdata)
  (let* ((bdat 	(make-bdat))
	 (fullp (common:get-this-exe-fullpath)))
    ;; bdat stuff
    (bdat-this-exe-fullpath-set! bdat fullp)
    (bdat-this-exe-dir-set! bdat (pathname-directory fullp))
    (bdat-this-exe-name-set! bdat (pathname-strip-directory fullp))
    (bdat-orig-env-set! bdat (get-the-original-environment))










    (set! *bdat* bdat)
    ;; set up signal handlers
    (set-signal-handler! signal/int  std-signal-handler)  ;; ^C
    (set-signal-handler! signal/term std-signal-handler)
    ;; (set-signal-handler! signal/stop std-signal-handler)  ;; ^Z NO, do NOT handle ^Z!
    bdat))








>
>
>
>
>














>
>
>














>
>
>
>
>
>
>
>
>
>







97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
(include "db_records.scm")

;; these come from processmod
;;
;; (define setenv set-environment-variable!)
;; (define unsetenv unset-environment-variable!)
;; (define getenv get-environment-variable)

;; move all the miscellanea into this struct
;;
(defstruct runs:gendat inc-results inc-results-last-update inc-results-fmt run-info runname target)


(define *bdat* #f) ;; the one and only (someday) global?

(defstruct bdat
  (home                   (getenv "HOME"))
  (user                   (getenv "USER"))
  (watchdog               #f)
  (time-to-exit           #f)
  (task-db                #f)
  (target                 #f)
  (this-exe-fullpath      #f)
  (this-exe-dir           #f)
  (this-exe-name          #f)
  (orig-env               #f)

  ;; runs stuff
  (runs-data              #f) ;; was runs:general-data
  ;; (server-loop-heart-beat (current-seconds))
  )

;; move all needed initialization into here
;; break it into pieces if need be later
;;
(define (make-and-init-bigdata)
  (let* ((bdat 	(make-bdat))
	 (fullp (common:get-this-exe-fullpath)))
    ;; bdat stuff
    (bdat-this-exe-fullpath-set! bdat fullp)
    (bdat-this-exe-dir-set! bdat (pathname-directory fullp))
    (bdat-this-exe-name-set! bdat (pathname-strip-directory fullp))
    (bdat-orig-env-set! bdat (get-the-original-environment))
    ;; setup runs-data
    (bdat-runs-data-set! bdat  (make-runs:gendat
				inc-results: (make-hash-table)
				inc-results-last-update: 0
				;;               state status time duration test-name item-path
				inc-results-fmt: "~12a~12a~20a~12a~40a\n"
				run-info: #f
				runname: #f
				target: #f))
    
    (set! *bdat* bdat)
    ;; set up signal handlers
    (set-signal-handler! signal/int  std-signal-handler)  ;; ^C
    (set-signal-handler! signal/term std-signal-handler)
    ;; (set-signal-handler! signal/stop std-signal-handler)  ;; ^Z NO, do NOT handle ^Z!
    bdat))

330
331
332
333
334
335
336

































337
338
339
340
341
342
343
;; D E B U G G I N G   S T U F F 
;;======================================================================

(define *verbosity*         1)
(define *logging*           #f)

(define *common:thread-punchlist* (make-hash-table))


































;;======================================================================
;; end globals
;;======================================================================

;;                       0           1              2              3
(defstruct launch:einf (pid #t)(exit-status #t)(exit-code #t)(rollup-status 0))







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
;; D E B U G G I N G   S T U F F 
;;======================================================================

(define *verbosity*         1)
(define *logging*           #f)

(define *common:thread-punchlist* (make-hash-table))

(define *last-num-running-tests* 0)
(define *seen-cant-run-tests* (make-hash-table)) ;; use to track tests that we suspect cannot be run
(define *runs:denoise* (make-hash-table)) ;; key => last-time-ran

(define runs:nothing-left-in-queue-count 0)

(define *max-tries-hash* (make-hash-table))

(define *send-receive-mutex* (make-mutex)) ;; should have separate mutex per run-id

(define *db:process-queue-mutex* (make-mutex))
(define *http-functions* (make-hash-table))
(define *http-mutex* (make-mutex))

;; NOTE: Large block of code from 32436b426188080f72fceb6894af541fbad9921e removed here
;;       I'm pretty sure it is defunct.

;; This next block all imported en-mass from the api branch
(define *http-requests-in-progress* 0)
(define *http-connections-next-cleanup* (current-seconds))

(define *number-of-writes* 0)
(define *number-non-write-queries* 0)

;; NB// #f => return dbdir only
;;      (was planned to be;  zeroth db with name=main.db)
;; 
;; If run-id is #f return to create and retrieve the path where the db will live.
;;
;; (define db:dbfile-path common:get-db-tmp-area)
(define *global-db-store* (make-hash-table))


;;======================================================================
;; end globals
;;======================================================================

;;                       0           1              2              3
(defstruct launch:einf (pid #t)(exit-status #t)(exit-code #t)(rollup-status 0))