Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -252,14 +252,18 @@ (> (/ delta df) 0.1)) ;; (> delta 200) ;; ignore changes under 200 Meg df #f))) (do-sync (or new-cpu-load new-disk-free over-time)) - (test-info (rmt:get-test-state-status-by-id run-id test-id)) - (state (car test-info));; (db:test-get-state test-info)) - (status (cdr test-info));; (db:test-get-status test-info)) - (killreq (equal? state "KILLREQ")) + ;; + ;; MOVE THIS TO A FILE FLAG BASED APPROACH (FOR NOW) + ;; + + ;; (test-info (rmt:get-test-state-status-by-id run-id test-id)) + ;; (state (car test-info));; (db:test-get-state test-info)) + ;; (status (cdr test-info));; (db:test-get-status test-info)) + (killreq (file-exists? (conc work-area"/kill-test"))) ;; (equal? state "KILLREQ")) (kill-reason "no kill reason specified") (kill-job? #f)) ;; (common:telemetry-log "zombie" (conc "launch:monitor-job - decision time encountered at "(current-seconds)" with last-sync="last-sync" do-sync="do-sync" over-time="over-time" update-period="update-period)) (cond (killreq @@ -266,21 +270,33 @@ (set! kill-reason "KILLING TEST since received kill request (KILLREQ)") (set! kill-job? #t)) ((and runtlim (> (- (current-seconds) start-seconds) runtlim)) (set! kill-reason (conc "KILLING TEST DUE TO TIME LIMIT EXCEEDED! Runtime=" (- (current-seconds) start-seconds) " seconds, limit=" runtlim)) (set! kill-job? #t)) - ((equal? status "DEAD") + #;((equal? status "DEAD") ;; NEED ALTERNATIVE MECHANISM FOR THIS. (tests:update-central-meta-info run-id test-id new-cpu-load new-disk-free (calc-minutes) #f #f) (rmt:set-state-status-and-roll-up-items run-id test-id 'foo "RUNNING" "n/a" "was marked dead; really still running.") ;;(set! kill-reason "KILLING TEST because it was marked as DEAD by launch:handle-zombie-tests (might indicate really overloaded server or else overzealous setup.deadtime)") ;; MARK RUNNING (set! kill-job? #f))) (debug:print 4 *default-log-port* "cpu: " new-cpu-load " disk: " new-disk-free " last-sync: " last-sync " do-sync: " do-sync) + + ;; revisit logic in zombie handling. + ;; (if (common:low-noise-print 600 "run zombie") ;; every five minutes is plenty (launch:handle-zombie-tests run-id)) + (when do-sync - (tests:update-central-meta-info run-id test-id new-cpu-load new-disk-free (calc-minutes) #f #f)) + ;; (tests:update-central-meta-info run-id test-id new-cpu-load new-disk-free (calc-minutes) #f #f) + + (let ((oup (open-output-file (conc work-area"/.run-logging-stats.csv") :append)) + (csv (conc run-id","test-id","new-cpu-load","new-disk-free","(calc-minutes)))) + (debug:print 0 *default-log-port* "Updating run log, csv="csv) + (with-output-to-port oup + (lambda () + (print csv))) + (close-output-port oup))) (if kill-job? (begin (debug:print-info 0 *default-log-port* "proceeding to kill test: "kill-reason) (mutex-lock! m) ADDED tests/longruntest/Makefile Index: tests/longruntest/Makefile ================================================================== --- /dev/null +++ tests/longruntest/Makefile @@ -0,0 +1,5 @@ + +cleanup : + killall mtest dboard -v -9 || true + rm -rf *.log *.bak NB* logs/* .meta .db /tmp/$(USER)/megatest_localdb/simplerun ../simpleruns/* lt + ADDED tests/longruntest/README Index: tests/longruntest/README ================================================================== --- /dev/null +++ tests/longruntest/README @@ -0,0 +1,1 @@ +Super simple test system - useful for testing db access. ADDED tests/longruntest/megatest.config Index: tests/longruntest/megatest.config ================================================================== --- /dev/null +++ tests/longruntest/megatest.config @@ -0,0 +1,53 @@ +# Copyright 2006-2017, Matthew Welland. +# +# This file is part of Megatest. +# +# Megatest is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Megatest is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Megatest. If not, see . + +[fields] +SYSTEM TEXT +RELEASE TEXT + +[setup] +# Adjust max_concurrent_jobs to limit how much you load your machines +max_concurrent_jobs 50 + +[server] +timeout 3 +# 3600 + +# Uncomment this to make the in-mem db into a disk based db (slower but good for debug) +# be aware that some unit tests will fail with this due to persistent data +# +# tmpdb /tmp + +# This is your link path, you can move it but it is generally better to keep it stable +linktree #{getenv MT_RUN_AREA_HOME}/../simplelinks + +# Valid values for state and status for steps, NB// It is not recommended you use this +[validvalues] +state start end completed + +# Job tools are more advanced ways to control how your jobs are launched +[jobtools] +# useshell yes +launcher nbfake + +# You can override environment variables for all your tests here +[env-override] +EXAMPLE_VAR example value + +# As you run more tests you may need to add additional disks, the names are arbitrary but must be unique +[disks] +disk0 #{getenv MT_RUN_AREA_HOME}/../simpleruns ADDED tests/longruntest/runconfigs.config Index: tests/longruntest/runconfigs.config ================================================================== --- /dev/null +++ tests/longruntest/runconfigs.config @@ -0,0 +1,24 @@ +# Copyright 2006-2017, Matthew Welland. +# +# This file is part of Megatest. +# +# Megatest is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Megatest is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Megatest. If not, see . + +[default] +ALLTESTS see this variable +!GLOBAL_WAITONS runfirst + +# Your variables here are grouped by targets [SYSTEM/RELEASE] +[SYSTEM_val/RELEASE_val] +ANOTHERVAR only defined if target is SYSTEM_val/RELEASE_val ADDED tests/longruntest/test.config Index: tests/longruntest/test.config ================================================================== --- /dev/null +++ tests/longruntest/test.config @@ -0,0 +1,48 @@ +# Copyright 2006-2017, Matthew Welland. +# +# This file is part of Megatest. +# +# Megatest is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Megatest is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Megatest. If not, see . + +[section1] +1 ./blah + +[section2] + +# A comment + +[disks] +1 ./ + +[validvalues] +state start end aborted +status pass fail n/a + +[include a file that doesn't exist] + + +blah nada + +# now inlcude a file tha tdoes exist +[include megatest.config] + +[metadata] +description This is a multiline + description. The leading whitespace is discarded + irrespective of amount of indenting. + This line is indented more. + + +author matt +lastreview never ADDED tests/longruntest/tests/runfirst/testconfig Index: tests/longruntest/tests/runfirst/testconfig ================================================================== --- /dev/null +++ tests/longruntest/tests/runfirst/testconfig @@ -0,0 +1,45 @@ +# Copyright 2006-2017, Matthew Welland. +# +# This file is part of Megatest. +# +# Megatest is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Megatest is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Megatest. If not, see . + +# Add additional steps here. Format is "stepname script" +[ezsteps] +step1 step1.sh +step2 step2.sh + +# Test requirements are specified here +[requirements] +# waiton setup +priority 0 + +# Iteration for your tests are controlled by the items section +[items] +PARTOFDAY morning noon afternoon evening night + +[scripts] +step1.sh #!/bin/bash + sleep 1 + +step2.sh #!/bin/bash + sleep 2 + +# test_meta is a section for storing additional data on your test +[test_meta] +author matt +owner matt +description An example test +tags tagone,tagtwo +reviewed never ADDED tests/longruntest/tests/test1/testconfig Index: tests/longruntest/tests/test1/testconfig ================================================================== --- /dev/null +++ tests/longruntest/tests/test1/testconfig @@ -0,0 +1,48 @@ +# Copyright 2006-2017, Matthew Welland. +# +# This file is part of Megatest. +# +# Megatest is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Megatest is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Megatest. If not, see . + +# Add additional steps here. Format is "stepname script" +[ezsteps] +createsteps createsteps.sh + +[scripts] +createsteps.sh #!/bin/bash + (for x in $(seq 20);do + echo "step$x sleep $x" + done) > #{getenv MT_RUN_AREA_HOME}/steps.config + +[logpro] +(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) +(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) +(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors + +# Test requirements are specified here +[requirements] +# waiton setup +priority 0 + +# Iteration for your tests are controlled by the items section +# [items] +# PARTOFDAY morning noon afternoon evening night + +# test_meta is a section for storing additional data on your test +[test_meta] +author matt +owner matt +description An example test +tags tagone,tagtwo +reviewed never ADDED tests/longruntest/tests/test2/testconfig Index: tests/longruntest/tests/test2/testconfig ================================================================== --- /dev/null +++ tests/longruntest/tests/test2/testconfig @@ -0,0 +1,42 @@ +# Copyright 2006-2017, Matthew Welland. +# +# This file is part of Megatest. +# +# Megatest is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Megatest is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Megatest. If not, see . + +# Add additional steps here. Format is "stepname script" +[ezsteps] +[include #{getenv MT_RUNAREAHOME}/steps.config] + +# Test requirements are specified here +[requirements] +waiton test1 +priority 0 + +# Iteration for your tests are controlled by the items section +[items] +LANDTYPE desert plains forest jungle beach + +[logpro] +(expect:ignore in "LogFileBody" < 99 "Ignore the word error in comments" #/^\/\/.*error/) +(expect:warning in "LogFileBody" = 0 "Any warning" #/warn/) +(expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/error/)) ;; but disallow any other errors + +# test_meta is a section for storing additional data on your test +[test_meta] +author matt +owner matt +description Yet another example test +tags tagone,tagtwo,quick +reviewed never