Megatest

Changes On Branch 150c672a53bf5833
Login

Changes In Branch better-html-update-control Through [150c672a53] Excluding Merge-Ins

This is equivalent to a diff from a0d9704d2f to 150c672a53

2015-03-09
05:19
Merging better-html-update-control to v1.60 check-in: bd663b5d13 user: matt tags: v1.60
05:18
Attempt to improve server recovery in bad situations Closed-Leaf check-in: 4125fe9193 user: matt tags: server-robustness
2015-03-07
22:33
Implemented simple locking for html update. check-in: e2a733c021 user: matt tags: better-html-update-control
2015-03-04
18:42
Better method for locking on html update check-in: 150c672a53 user: mrwellan tags: better-html-update-control
08:41
Moved delay in can-run-more-tests out of the main path check-in: a0d9704d2f user: mrwellan tags: v1.60
06:55
Merged in the static-html branch check-in: 16e4ac3a73 user: mrwellan tags: v1.60

Modified launch.scm from [65077b4cd7] to [c50b0e51c3].

433
434
435
436
437
438
439
440
441
442



443
444
445
446
447
448
449
433
434
435
436
437
438
439



440
441
442
443
444
445
446
447
448
449







-
-
-
+
+
+







					    new-state
					    new-status
					    (args:get-arg "-m") #f)
		    ;; need to update the top test record if PASS or FAIL and this is a subtest
		    ;; NO NEED TO CALL roll-up-pass-fail-counts HERE, THIS IS DONE IN roll-up-pass-fail-counts called by tests:test-set-status!
		    ))
	      ;; for automated creation of the rollup html file this is a good place...
	      (if (and (not (equal? item-path ""))
		       (< (random (rmt:get-count-tests-running-for-testname run-id test-name)) 5))
		  (tests:summarize-items run-id test-id test-name #f))
	      ;; (if (and (not (equal? item-path ""))
	      ;;      (< (random (rmt:get-count-tests-running-for-testname run-id test-name)) 5))
	      (tests:summarize-items run-id test-id test-name #f)
	      (tests:summarize-test run-id test-id)) ;; don't force - just update if no
	    (mutex-unlock! m)
	    (debug:print 2 "Output from running " fullrunscript ", pid " (vector-ref exit-info 0) " in work area " 
			 work-area ":\n====\n exit code " (vector-ref exit-info 2) "\n" "====\n")
	    (if (not (vector-ref exit-info 1))
		(exit 4)))))))

Modified lock-queue.scm from [4e7622a7f2] to [1e70529cd9].

117
118
119
120
121
122
123
124

125
126
127
128
129
130
131





132
133
134
135
136
137
138
117
118
119
120
121
122
123

124
125
126





127
128
129
130
131
132
133
134
135
136
137
138







-
+


-
-
-
-
-
+
+
+
+
+







	 (db        (lock-queue:db-dat-get-db dbdat))
	 (lckqry    (sqlite3:prepare db "SELECT test_id,run_lock FROM runlocks WHERE run_lock='locked';"))
	 (mklckqry  (sqlite3:prepare db "INSERT INTO runlocks (test_id,run_lock) VALUES (?,'locked');")))
    (let ((result 
	   (handle-exceptions
	    exn
	    (begin
	      (debug:print 0 "WARNING: failed to get queue lock. Will try again in a few seconds")
	      (debug:print 0 "WARNING: failed to get queue lock. Removing lock db and returning fail") ;; Will try again in a few seconds")
	      (debug:print 0 " message: " ((condition-property-accessor 'exn 'message) exn))
	      (thread-sleep! 10)
	      (if (> count 0)
		  (lock-queue:get-lock dbdat test-id count: (- count 1))
		  (begin ;; never recovered, remote the lock file and return #f, no lock obtained
		    (lock-queue:delete-lock-db dbdat)
		    #f)))
	      ;; (if (> count 0)	
	      ;;  #f ;; (lock-queue:get-lock dbdat test-id count: (- count 1)) - give up on retries 
	      ;; (begin ;; never recovered, remote the lock file and return #f, no lock obtained
	      (lock-queue:delete-lock-db dbdat)
	      #f)
	    (sqlite3:with-transaction
	     db
	     (lambda ()
	       (sqlite3:for-each-row (lambda (tid lockstate)
				       (set! res (list tid lockstate)))
				     lckqry)
	       (if res