Overview
Comment: | Refactored to move most of the work to scan and recover dead tests out of the servers. This commit also fixes dependencies in the Makefile. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | v1.80 |
Files: | files | file ages | folders |
SHA1: |
c75b58ded796b22be29e2c051bbf9504 |
User & Date: | matt on 2023-04-12 06:38:01 |
Other Links: | branch diff | manifest | tags |
Context
2023-04-12
| ||
06:59 | Fix random issue with directory creation when parallel startup causes collisions check-in: 07ee6da7ba user: matt tags: v1.80 | |
06:38 | Refactored to move most of the work to scan and recover dead tests out of the servers. This commit also fixes dependencies in the Makefile. check-in: c75b58ded7 user: matt tags: v1.80 | |
2023-04-11
| ||
21:32 | Throttle writes more than reads using mutex, avoid doing sync when writes are happening using mutex. This is a monte carlo approach. Might need tweaking. check-in: b5df408582 user: matt tags: v1.80 | |
Changes
Modified Makefile from [9d72ba0941] to [3b43ac8a9b].
︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | - + | # # You should have received a copy of the GNU General Public License # along with Megatest. If not, see <http://www.gnu.org/licenses/>. # make install CSCOPTS='-accumulate-profile -profile-name $(PWD)/profile-ww$(shell date +%V.%u)' # rm <files>.o ; make install CSCOPTS='-profile' ; ... ; chicken-profile | less |
︙ | |||
49 50 51 52 53 54 55 | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | - + | mofiles/portlogger.o : mofiles/dbmod.o mofiles/dbfile.o : \ mofiles/debugprint.o mofiles/commonmod.o configf.o : commonmod.import.o mofiles/dbfile.o : mofiles/debugprint.o |
︙ | |||
83 84 85 86 87 88 89 90 91 92 93 94 95 96 | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | + | # csc $(CSCOPTS) -I mofiles -I $* -J -c $< -o $*.o # cp $*.o mofiles/$*.o # @touch $*.import.scm # ensure it is touched after the .o is made %.import.scm mofiles/%.o : %.scm @mkdir -p mofiles csc $(CSCOPTS) -J -c $< -o mofiles/$*.o @if [[ -e $*.import.scm ]];then touch $*.import.scm;fi # ensure it is touched after the .o is made ADTLSCR=mt_laststep mt_runstep mt_ezstep HELPERS=$(addprefix $(PREFIX)/bin/,$(ADTLSCR)) DEPLOYHELPERS=$(addprefix deploytarg/,$(ADTLSCR)) MTESTHASH=$(shell fossil info|grep checkout:| awk '{print $$2}') ifeq ($(MTESTHASH),) |
︙ | |||
118 119 120 121 122 123 124 | 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 157 158 159 160 161 162 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | csc $(CSCOPTS) $(OFILES) dashboard.scm $(GOFILES) $(MOFILES) $(MOIMPFILES) -o dboard mtut: $(OFILES) $(MOFILES) $(MOIMPFILES) megatest-fossil-hash.scm mtut.scm megatest-version.scm csc $(CSCOPTS) $(OFILES) $(MOFILES) $(MOIMPFILES) mtut.scm -o mtut # include makefile.inc |
︙ | |||
169 170 171 172 173 174 175 | 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | - + | $(PREFIX)/share/db/mt-pg.sql : mt-pg.sql mkdir -p $(PREFIX)/share/db $(INSTALL) mt-pg.sql $(PREFIX)/share/db/mt-pg.sql # Special dependencies for the includes $(MOFILE) $(MOIMPFILES) : megatest-fossil-hash.scm |
︙ | |||
274 275 276 277 278 279 280 | 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | - - - - - - + + + + + + | $(PREFIX)/bin/mtexec : $(PREFIX)/bin/.$(ARCHSTR)/mtexec utils/mk_wrapper utils/mk_wrapper $(PREFIX) mtexec $(PREFIX)/bin/mtexec chmod a+x $(PREFIX)/bin/mtexec # tcmt |
︙ | |||
377 378 379 380 381 382 383 | 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 | - + - + | install : $(PREFIX)/bin/.$(ARCHSTR) $(PREFIX)/bin/.$(ARCHSTR)/mtest $(PREFIX)/bin/megatest \ $(PREFIX)/bin/.$(ARCHSTR)/dboard $(PREFIX)/bin/dashboard $(HELPERS) $(PREFIX)/bin/nbfake \ $(PREFIX)/bin/nbfind $(PREFIX)/bin/mtrunner $(PREFIX)/bin/viewscreen $(PREFIX)/bin/mt_xterm \ $(PREFIX)/bin/mt-old-to-new.sh $(PREFIX)/bin/mt-new-to-old.sh \ $(PREFIX)/share/docs/megatest_manual.html $(PREFIX)/bin/remrun \ $(PREFIX)/share/docs/megatest_manual.html $(PREFIX)/bin/remrun $(PREFIX)/bin/mtutil \ |
︙ |
Modified api.scm from [b07878d20a] to [9008afe383].
︙ | |||
30 31 32 33 34 35 36 37 38 39 40 41 42 43 | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | + | (import commonmod) (import dbmod) (import dbfile) (import debugprint) (import tcp-transportmod) (use srfi-69 srfi-18 posix matchable s11n) ;; allow these queries through without starting a server ;; (define api:read-only-queries |
︙ | |||
343 344 345 346 347 348 349 | 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 | + + - + + | ;; 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 db:initialize-main-db force-sync: #t))) ((get-toplevels-and-incompletes) (apply db:get-toplevels-and-incompletes dbstruct params)) ((mark-incomplete) #f);;(thread-start! (make-thread (lambda () ;; no need to block on this one |
︙ |
Modified common.scm from [dad201907b] to [ec316c51cd].
︙ | |||
2044 2045 2046 2047 2048 2049 2050 | 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 | - - - - - - - - - - - - - - - - - | (if (and (number? result) (> result 0)) (common:write-cached-info actual-host "num-cpus" result)) result)))) (hash-table-set! *numcpus-cache* actual-host numcpus) numcpus)))) |
︙ |
Modified commonmod.scm from [19a34cf301] to [a0125e2f23].
︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | - + + - + + + + | ;; ;; You should have received a copy of the GNU General Public License ;; along with Megatest. If not, see <http://www.gnu.org/licenses/>. ;;====================================================================== (declare (unit commonmod)) |
︙ | |||
695 696 697 698 699 700 701 702 | 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 | + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + | (else exe))))) '("../../" "../"))))) (if (null? res) (begin ;; (debug:print 0 *default-log-port* "Failed to find this executable! Using what can be found on the path") progname) (car res)))) (define (common:generic-ssh ssh-command proc default #!optional (msg-proc #f)) (let ((inp #f)) (handle-exceptions exn (begin (close-input-port inp) (if msg-proc (msg-proc) (debug:print 0 *default-log-port* "Command: \""ssh-command"\" failed. exn="exn)) default) (set! inp (open-input-pipe ssh-command)) (with-input-from-port inp (lambda () (let ((res (proc))) (close-input-port inp) res)))))) |
Modified dashboard.scm from [b98c976a8a] to [7114e0e406].
︙ | |||
20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | + | (declare (uses common)) (declare (uses mtargs)) (declare (uses mtargs.import)) (declare (uses keys)) (declare (uses items)) (declare (uses debugprint)) (declare (uses debugprint.import)) (declare (uses db)) (declare (uses configf)) (declare (uses process)) (declare (uses launch)) (declare (uses runs)) (declare (uses dashboard-tests)) (declare (uses tree)) |
︙ | |||
70 71 72 73 74 75 76 77 78 79 80 81 82 83 | 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | + | (include "vg_records.scm") ;; set some parameters here - these need to be put in something that can be loaded from other ;; executables such as dashboard and mtutil ;; (include "dashboard-transport-mode.scm") (dbfile:db-init-proc db:initialize-main-db) (set! rmtmod:send-receive rmt:send-receive) (define help (conc "Megatest Dashboard, documentation at http://www.kiatoa.com/fossils/megatest version " megatest-version " license GPL, Copyright (C) Matt Welland 2012-2017 Usage: dashboard [options] -h : this help |
︙ |
Modified db.scm from [18cf960c23] to [3353e0f2ec].
︙ | |||
1109 1110 1111 1112 1113 1114 1115 | 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ;; (debug:print-info 18 *default-log-port* "Found " (length oldlaunched) " old LAUNCHED items, " (length toplevels) " old LAUNCHED toplevel tests and " (length incompleted) " tests marked RUNNING but apparently dead.") ;; (if (and (null? incompleted) ;; (null? oldlaunched) ;; (null? toplevels)) ;; #f ;; #t))))) |
︙ |
Modified db_records.scm from [6eb715496b] to [92d912cdd4].
︙ | |||
14 15 16 17 18 19 20 | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | - - - - - - - - - - | ;; ;; You should have received a copy of the GNU General Public License ;; along with Megatest. If not, see <http://www.gnu.org/licenses/>. ;;====================================================================== ;; dbstruct ;;====================================================================== |
︙ |
Modified launch.scm from [d5ebd1ded6] to [73ea6dbf9b].
︙ | |||
838 839 840 841 842 843 844 | 838 839 840 841 842 843 844 845 846 847 848 849 850 851 | - - - - - - - - - - - - - - - - - - - - - | (output (with-input-from-pipe cmd read-lines))) (debug:print 2 *default-log-port* "Running " cmd " received " output) (if (eq? (length output) 0) #f #t)) #t)) |
︙ |
Modified megatest.scm from [6f4fa87a54] to [5b9e4f0ac8].
︙ | |||
23 24 25 26 27 28 29 30 31 32 33 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | + + - - | (define (toplevel-command . a) #f) (declare (uses common)) ;; (declare (uses megatest-version)) ;; (declare (uses margs)) ;; (declare (uses mtargs)) ;; (declare (uses mtargs.import)) (declare (uses debugprint)) (declare (uses debugprint.import)) (declare (uses commonmod)) (declare (uses commonmod.import)) (declare (uses mtargs)) (declare (uses mtargs.import)) |
︙ |
Modified mtargs.scm from [1e6b59e54f] to [22cf29b180].
︙ | |||
15 16 17 18 19 20 21 22 23 | 15 16 17 18 19 20 21 22 23 24 25 | + + | ;; ;; You should have received a copy of the GNU General Public License ;; along with Megatest. If not, see <http://www.gnu.org/licenses/>. ;;====================================================================== (declare (unit mtargs)) (use srfi-69) (include "mtargs/mtargs.scm") |
Modified rmt.scm from [35e00a1063] to [0af3ea0170].
︙ | |||
312 313 314 315 316 317 318 | 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | (rmt:send-receive 'get-run-times #f (list runpatt targetpatt ))) ;;====================================================================== ;; T E S T S ;;====================================================================== |
︙ | |||
499 500 501 502 503 504 505 | 437 438 439 440 441 442 443 444 445 446 447 448 449 450 | - - - - - - | (assert (number? run-id) "FATAL: Run id required.") (rmt:send-receive 'get-count-tests-running-for-testname run-id (list run-id testname))) (define (rmt:get-count-tests-running-in-jobgroup run-id jobgroup) (assert (number? run-id) "FATAL: Run id required.") (rmt:send-receive 'get-count-tests-running-in-jobgroup run-id (list run-id jobgroup))) |
︙ | |||
829 830 831 832 833 834 835 | 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 | + + + + + + + + + + | (if runremote (begin (tt-ro-mode-set! runremote ro-mode) (tt-ro-mode-checked-set! runremote #t) ro-mode) ro-mode)))))) ;;====================================================================== ;; Maintenance ;;====================================================================== (define (rmt:find-and-mark-incomplete run-id ovr-deadtime) (let* ((cfg-deadtime (configf:lookup-number *configdat* "setup" "deadtime")) (test-stats-update-period (configf:lookup-number *configdat* "setup" "test-stats-update-period"))) (rmt:find-and-mark-incomplete-engine run-id ovr-deadtime cfg-deadtime test-stats-update-period) ;;call end of eud of run detection for posthook (launch:end-of-run-check run-id))) |
Modified rmtmod.scm from [5ddda54a47] to [c4f748fe17].
︙ | |||
15 16 17 18 19 20 21 22 23 | 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | + - - + + + | ;; ;; You should have received a copy of the GNU General Public License ;; along with Megatest. If not, see <http://www.gnu.org/licenses/>. ;;====================================================================== (declare (unit rmtmod)) (declare (uses debugprint)) (declare (uses commonmod)) (declare (uses dbfile)) ;; needed for records |
︙ | |||
107 108 109 110 111 112 113 114 115 | 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 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 | + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | (define (rmt:insert-test run-id test-rec) (let* ((testname (alist-ref "testname" test-rec equal?)) (item-path (alist-ref "item_path" test-rec equal?))) (debug:print 0 *default-log-port* " Insert test in run "run-id": "testname"/"item-path) (rmtmod:send-receive 'insert-test run-id test-rec))) ;;====================================================================== ;; T E S T S ;;====================================================================== ;; Just some syntatic sugar (define (rmt:register-test run-id test-name item-path) (assert (number? run-id) "FATAL: Run id required.") (rmt:general-call 'register-test run-id run-id test-name item-path)) (define (rmt:get-test-id run-id testname item-path) (assert (number? run-id) "FATAL: Run id required.") (rmtmod:send-receive 'get-test-id run-id (list run-id testname item-path))) |