Megatest

Check-in [fbc6ca10e6]
Login
Overview
Comment:reverted use of dbstruct to db as it is inside a transaction, must access the db directly and not invoke all the magically machinery that will dynamically open up new database handles.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.64-runs-deepdive
Files: files | file ages | folders
SHA1: fbc6ca10e6eb8cb78bc5b21925bfcb96b89e9c9f
User & Date: matt on 2017-09-13 22:00:20
Other Links: branch diff | manifest | tags
Context
2017-09-14
15:31
keep-running issue addressed Leaf check-in: b6d97c539d user: bjbarcla tags: v1.64-runs-deepdive
2017-09-13
22:00
reverted use of dbstruct to db as it is inside a transaction, must access the db directly and not invoke all the magically machinery that will dynamically open up new database handles. check-in: fbc6ca10e6 user: matt tags: v1.64-runs-deepdive
18:00
Revert the usage of mutex in db:locked .... check-in: 70456688e4 user: mrwellan tags: v1.64-runs-deepdive
Changes

Modified db.scm from [d8f9f61257] to [5779ba7201].

3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
                                                    (if (not (equal? state "DELETED"))
                                                        (cons status (map dbr:counts-status state-status-counts))
                                                        (map dbr:counts-status state-status-counts)))
                                                   *common:std-statuses* >))
			    (non-completes     (filter (lambda (x)
							 (not (equal? x "COMPLETED")))
						       all-curr-states))
                            (preq-fails        (filter (lambda (x)
							 (equal? x "PREQ_FAIL"))
						       all-curr-statuses))
                            (num-non-completes (length non-completes))
                            (newstate          (cond
						((> running 0)
						 "RUNNING") ;; anything running, call the situation running
                                                ;;((> (length preq-fails) 0)
                                                ;; "NOT_STARTED")
						((> bad-not-started 0)  ;; we have an ugly situation, it is completed in the sense we cannot do more.
						 "COMPLETED") 
						((> num-non-completes 0) ;;
						 (car non-completes))  ;;  (remove (lambda (x)(equal? "COMPLETED" x)) all-curr-states)))
                                                ;; only rollup DELETED if all DELETED
						(else
						 (car all-curr-states))))
			                       ;; (if (> running 0)
                                               ;;     "RUNNING"
                                               ;;     (if (> bad-not-started 0)
                                               ;;         "COMPLETED"
                                               ;;         (car all-curr-states))))
                            ;; (newstatus         (cond
                            ;;                     ;;((> (length preq-fails) 0)







|




<
|
|
<
|
<
<
|
<
<
|







3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502

3503
3504

3505


3506


3507
3508
3509
3510
3511
3512
3513
3514
                                                    (if (not (equal? state "DELETED"))
                                                        (cons status (map dbr:counts-status state-status-counts))
                                                        (map dbr:counts-status state-status-counts)))
                                                   *common:std-statuses* >))
			    (non-completes     (filter (lambda (x)
							 (not (equal? x "COMPLETED")))
						       all-curr-states))
			    (preq-fails        (filter (lambda (x)
							 (equal? x "PREQ_FAIL"))
						       all-curr-statuses))
                            (num-non-completes (length non-completes))
                            (newstate          (cond

						((> running 0)           "RUNNING")            ;; anything running, call the situation running
                                                ;;((> (length preq-fails) 0)                                                ;; "NOT_STARTED")

						((> bad-not-started 0)   "COMPLETED")          ;; we have an ugly situation, it is completed in the sense we cannot do more.


						((> num-non-completes 0) (car non-completes))  ;;  (remove (lambda (x)(equal? "COMPLETED" x)) all-curr-states))) ;; only rollup DELETED if all DELETED


						(else                    (car all-curr-states))))
			                       ;; (if (> running 0)
                                               ;;     "RUNNING"
                                               ;;     (if (> bad-not-started 0)
                                               ;;         "COMPLETED"
                                               ;;         (car all-curr-states))))
                            ;; (newstatus         (cond
                            ;;                     ;;((> (length preq-fails) 0)
3539
3540
3541
3542
3543
3544
3545
3546

3547
3548
3549
3550
3551
3552
3553
                                           (map (lambda (x)
                                                  (conc
                                                   (with-output-to-string (lambda () (pp (dbr:counts->alist x)))) " | "))
                                                state-status-counts))
                                    
                                    ); end debug:print
                       (if tl-test-id
			   (db:test-set-state-status dbstruct run-id tl-test-id newstate newstatus #f))))))))

         (mutex-unlock! *db-transaction-mutex*)
         (if (and test-id state status (equal? status "AUTO")) 
             (db:test-data-rollup dbstruct run-id test-id status))
         tr-res)))))
;; BBnote: db:get-all-state-status-counts-for-test returns dbr:counts object aggregating state and status of items of a given test, *not including rollup state/status*
(define (db:get-all-state-status-counts-for-test dbstruct run-id test-name item-path)
  (db:with-db







|
>







3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
                                           (map (lambda (x)
                                                  (conc
                                                   (with-output-to-string (lambda () (pp (dbr:counts->alist x)))) " | "))
                                                state-status-counts))
                                    
                                    ); end debug:print
                       (if tl-test-id
			   (db:test-set-state-status db run-id tl-test-id newstate newstatus #f)) ;; we are still in the transaction - must access the db and not the dbstruct
		       ))))))
         (mutex-unlock! *db-transaction-mutex*)
         (if (and test-id state status (equal? status "AUTO")) 
             (db:test-data-rollup dbstruct run-id test-id status))
         tr-res)))))
;; BBnote: db:get-all-state-status-counts-for-test returns dbr:counts object aggregating state and status of items of a given test, *not including rollup state/status*
(define (db:get-all-state-status-counts-for-test dbstruct run-id test-name item-path)
  (db:with-db