Megatest

Check-in [31c178ba40]
Login
Overview
Comment:wip
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.6584-nanomsg
Files: files | file ages | folders
SHA1: 31c178ba40de031b4873067d77b744a25bafc1ba
User & Date: matt on 2021-11-29 09:38:34
Other Links: branch diff | manifest | tags
Context
2021-11-29
18:41
Corrected - but not quite - the calls to get-inmem Leaf check-in: 3ebb15bd95 user: matt tags: v1.6584-nanomsg
09:38
wip check-in: 31c178ba40 user: matt tags: v1.6584-nanomsg
2021-11-27
19:55
wip, but getting some serious traction check-in: 93f367cac6 user: matt tags: v1.6584-nanomsg
Changes

Modified apimod.scm from [d5b17eca2f] to [e18f34d37e].

257
258
259
260
261
262
263
264
265
266



267
268
269
270
271
272
273
257
258
259
260
261
262
263



264
265
266
267
268
269
270
271
272
273







-
-
-
+
+
+







    ;; TEST DATA
    ((test-data-rollup)             (apply db:test-data-rollup dbstruct params))
    ((csv->test-data)               (apply db:csv->test-data dbstruct params))

    ;; MISC
    ;;                    ((sync-inmem->db)               (let ((run-id (car params)))
    ;;                                                      (db:sync-touched dbstruct run-id force-sync: #t)))
    ;;                    ((mark-incomplete)              (apply db:find-and-mark-incomplete dbstruct params))
    ;;                    ((create-all-triggers)          (db:create-all-triggers dbstruct))
    ;;                    ((drop-all-triggers)            (db:drop-all-triggers dbstruct)) 
    ((mark-incomplete)              (apply db:find-and-mark-incomplete dbstruct params))
    ((create-all-triggers)          (db:create-all-triggers dbstruct))
    ((drop-all-triggers)            (db:drop-all-triggers dbstruct)) 

    ;; TESTMETA
    ((testmeta-add-record)       (apply db:testmeta-add-record dbstruct params))
    ((testmeta-update-field)     (apply db:testmeta-update-field dbstruct params))
    ((get-tests-tags)            (db:get-tests-tags dbstruct))

    ;; TASKS
415
416
417
418
419
420
421
422

423
424

425
426
427
428
429
430
431
432
433

434
435
436
437
438
439
440
441
442
443
444
445
415
416
417
418
419
420
421

422
423

424
425
426
427
428
429
430
431
432

433
434
435
436
437
438
439
440
441
442
443
444
445







-
+

-
+








-
+












;; NB// Runs on the server as part of the server loop
;;
(define (api:process-request dbstruct indat) ;; the $ is the request vars proc
  (let* ((cmd-in  (alist-ref 'cmd indat)) ;; ($ 'cmd))
	 (cmd     (if (string? cmd-in)(string->symbol cmd-in) cmd-in))
	 (params  (alist-ref 'params indat))
         (key     (alist-ref 'key indat))    ;; TODO - add this back
	 (doprint (apply common:low-noise-print 10 params))
	 ;; (doprint (apply common:low-noise-print 10 params))
	 )
    (if doprint (debug:print 0 *default-log-port* "cmd: " cmd " with params: " params ", key: " key))
    ;; (if doprint (debug:print 0 *default-log-port* "cmd: " cmd " with params: " params ", key: " key))
    (case cmd-in
      ((ping) #t)
      ;; ((quit) (exit))
      (else
       (if (equal? key *my-signature*) ;; TODO - get real key involved
	   (begin
	     (set! *api-process-request-count* (+ *api-process-request-count* 1))
	     (let* ((res (api:execute-requests dbstruct cmd params))) 
	       (if doprint (debug:print 0 *default-log-port* "res:" res))
	       ;; (if doprint (debug:print 0 *default-log-port* "res:" res))
	       #;(if (not success)
	       (debug:print 0 *default-log-port* "ERROR: success flag is #f for " cmd " with params " params))
	       (if (> *api-process-request-count* *max-api-process-requests*)
		   (set! *max-api-process-requests* *api-process-request-count*))
	       (set! *api-process-request-count* (- *api-process-request-count* 1))
	       #;(sexpr->string res)
	       res))
	   (begin
	     (debug:print 0 *default-log-port*   "Server refused to process request. Sever id mismatch. recived " key " expected:  " *my-signature* ".\nOther arguments recived: cmd=" cmd " params = " params) 
	     (conc "Server refused to process request server signature mismatch: " key ", " *my-signature*)))))))

)

Modified dbmod.scm from [7009181adc] to [64753ab17f].

1437
1438
1439
1440
1441
1442
1443
1444

1445
1446
1447
1448
1449
1450
1451
1437
1438
1439
1440
1441
1442
1443

1444
1445
1446
1447
1448
1449
1450
1451







-
+







                               END;" )))

(define (db:create-all-triggers dbstruct run-id)
(db:with-db
   dbstruct run-id #f
   (lambda (db)
(db:create-triggers db))))

; "SELECT count(id) FROM tests WHERE state in ('RUNNING','LAUNCHED','REMOTEHOSTSTART') AND run_id=
(define (db:create-triggers db)
    (for-each (lambda (key)
              (sqlite3:execute db (cadr key)))
          db:trigger-list))

(define (db:drop-all-triggers dbstruct run-id)
  (db:with-db

Modified megatest.scm from [62c0ff51dd] to [ca9d861939].

888
889
890
891
892
893
894
895
896


897
898
899
900
901
902
903
888
889
890
891
892
893
894


895
896
897
898
899
900
901
902
903







-
-
+
+







           (debug:print 0 *default-log-port* "WARNING: -itempatt has been deprecated, please use -testpatt testpatt/itempatt method, new testpatt is "newval)
           (hash-table-set! args:arg-hash "-testpatt" newval)
           (hash-table-delete! args:arg-hash "-itempatt")))
     
     (if (args:get-arg "-runtests")
         (debug:print 0 *default-log-port* "WARNING: \"-runtests\" is deprecated. Use \"-run\" with \"-testpatt\" instead"))

     (debug:print 0 *default-log-port* "on-exit disabled. Please re-enable")
     ;; (on-exit std-exit-procedure)
     ;; (debug:print 0 *default-log-port* "on-exit disabled. Please re-enable")
     (on-exit std-exit-procedure)
     
     ;;======================================================================
     ;; Misc general calls
     ;;======================================================================

;; TODO: Restore this functionality

Modified runsmod.scm from [e100729d19] to [e0bbf25b11].

646
647
648
649
650
651
652

653

654
655
656
657
658

659
660
661
662
663
664
665
646
647
648
649
650
651
652
653

654
655
656
657
658

659
660
661
662
663
664
665
666







+
-
+




-
+







							       exn
							       (debug:print 0 *default-log-port* "error in calling find-and-mark-incomplete for run-id " run-id ", exn=" exn)
							       (runs:find-and-mark-incomplete-and-check-end-of-run run-id #f)))) ;; ovr-deadtime))) ;; could be root of https://hsdes.intel.com/appstore/article/#/220546828/main -- Title: Megatest jobs show DEAD even though they are still running (1.64/27)
							run-ids)))
					  "runs: mark-incompletes")))
	    ;; (thread-start! th1)
	    (thread-start! th2)
	    (thread-join! th2) ;; turn off marking incompletes in parallel. see if it is related to the db locks we are seeing.
	    ;; (thread-join! th1)
	    
	    ;; just do the main stuff in the main thread
	    (runs:run-tests-queue run-id runname test-records keyvals flags test-patts required-tests
								    (any->number reglen) all-tests-registry)
	    (set! keep-going #f)
	    (thread-join! th2)
	    ;; (thread-join! th2)
	    ;; if run-count > 0 call, set -preclean and -rerun STUCK/DEAD
	    (if (> run-count 0) ;; handle reruns
		(begin
		  (if (not (hash-table-ref/default flags "-preclean" #f))
		      (hash-table-set! flags "-preclean" #t))
		  (if (not (hash-table-ref/default flags "-rerun" #f))
		      (hash-table-set! flags "-rerun" "ABORT,STUCK/DEAD,n/a,ZERO_ITEMS"))