diff --git a/code/common/dbwriteutils.q b/code/common/dbwriteutils.q index 97a997fb5..f3bdc6a72 100644 --- a/code/common/dbwriteutils.q +++ b/code/common/dbwriteutils.q @@ -79,7 +79,7 @@ manipulate:{[t;x] /- post eod/replay, this is called after the date has been persisted to disk and sorted and /- takes a directory (typically hdb directory) and partition value as parameters -postreplay:@[value;`postreplay;{[d;p] }]; +postreplay:@[value;`postreplay;{[e] {[d;p] }}]; / - functions for running and descriptively logging garbage collection \d .gc diff --git a/code/common/html.q b/code/common/html.q index c927c8272..cbe6a1262 100644 --- a/code/common/html.q +++ b/code/common/html.q @@ -39,7 +39,7 @@ add:{$[(count w x)>i:w[x;;0]?.z.w;.[`.u.w;(x;i;1);union;y];w[x],:enlist(.z.w;y)] sub:{if[x~`;:sub[;y]each t];if[not x in t;'x];del[x].z.w;add[x;y]} // add wssub method - have to subscribe to everything, don't return anything -wssub:{sub[x;`];} +wssub:{if[x~`;.z.s each t;:(::)];if[not x in t;'x];del[x].z.w;w[x],:enlist(.z.w;`);} end:{(neg union/[w[;;0]])@\:(`.u.end;x)} diff --git a/code/handlers/trackservers.q b/code/handlers/trackservers.q index fda2115d3..6f0c05b99 100644 --- a/code/handlers/trackservers.q +++ b/code/handlers/trackservers.q @@ -138,7 +138,7 @@ getdetails:{(.z.f;.z.h;system"p";@[value;`.proc.procname;`];@[value;`.proc.proct / add session behind a handle addhw:{[hpuP;W] // Get the information around a process - info:`f`h`port`procname`proctype`attributes!(@[W;({$[`getdetails in key`.servers;.servers.getdetails[];(.z.f;.z.h;system"p";`;`;$[`getattributes in key`.proc;.proc.getattributes[];()!()])]};`);(`;`;0Ni;`;`;()!())]); + info:`f`h`port`procname`proctype`attributes!(@[W;({$[`getdetails in key`.servers;.servers.getdetails[];(.z.f;.z.h;system"p";@[value;`.proc.procname;`];@[value;`.proc.proctype;`];$[`getattributes in key`.proc;.proc.getattributes[];()!()])]};`);(`;`;0Ni;`;`;()!())]); if[0Ni~info`port;'"remote call failed on handle ",string W]; if[null name:info`procname;name:`$last("/"vs string info`f)except enlist""]; if[0=count name;name:`default]; diff --git a/code/segmentedtickerplant/stplog.q b/code/segmentedtickerplant/stplog.q index b587c7311..0ab3dd60d 100644 --- a/code/segmentedtickerplant/stplog.q +++ b/code/segmentedtickerplant/stplog.q @@ -5,6 +5,9 @@ currlog:([tbl:`symbol$()]logname:`symbol$();handle:`int$()) // View of log file handles for faster lookups loghandles::exec tbl!handle from currlog +// Re-establish the view above. A chained tickerplant which is not creating logs replaces it with a dictionary of +// no-ops (see init); without this, switching that process to create its own logs opened them but wrote nothing +restoreloghandles:{value "loghandles::exec tbl!handle from currlog"}; \d .stplg @@ -184,7 +187,8 @@ endofdaydata:@[value;`.stplg.endofdaydata;{ {`proctype`procname`tables!(.proc.pr // passes on eop messages to subscribers and rolls logs endofperiod:{[currentpd;nextpd;data] .lg.o[`endofperiod;"flushing remaining data to subscribers and clearing tables"]; - .stpps.pubclear[.stplg.t]; + // the published tables only: pubclear resets a table from the publish schemas, which have no entry for logmsg + .stpps.pubclear[.stpps.t]; .lg.o[`endofperiod;"executing end of period for ",.Q.s1 `currentperiod`nextperiod!(currentpd;nextpd)]; .stpps.endp[currentpd;nextpd;data]; // sends endofperiod message to subscribers currperiod::nextpd; // increments current period @@ -195,7 +199,8 @@ endofperiod:{[currentpd;nextpd;data] // eop log roll is stopped if eod is also going to be triggered (roll is not stopped in SCTP) stpeoperiod:{[currentpd;nextpd;data;rolllogs] .lg.o[`endofperiod;"flushing remaining data to subscribers and clearing tables"]; - .stpps.pubclear[.stplg.t]; + // the published tables only: pubclear resets a table from the publish schemas, which have no entry for logmsg + .stpps.pubclear[.stpps.t]; .lg.o[`stpeoperiod;"passing on endofperiod message to subscribers"]; .stpps.endp[currentpd;nextpd;data]; // sends endofperiod message to subscribers currperiod::nextperiod; // increments current period @@ -215,7 +220,8 @@ periodrollover:{[data] // common eod for STP and SCTP to send out eod messages and roll logs endofday:{[date;data] .lg.o[`endofday;"flushing remaining data to subscribers and clearing tables"]; - .stpps.pubclear[.stplg.t]; + // the published tables only: pubclear resets a table from the publish schemas, which have no entry for logmsg + .stpps.pubclear[.stpps.t]; .lg.o[`endofday;"executing end of day for ",.Q.s1 .eodtime.d]; .stpps.end[date;data]; // sends endofday message to subscribers dayrollover[data]; @@ -259,6 +265,7 @@ init:{[dbname] seqnum::0; if[(value `..createlogs) or .sctp.loggingmode=`create; + if[.sctp.chainedtp;`.[`restoreloghandles][]]; createdld[dbname;.eodtime.d]; openlog[multilog;dldir;;.z.p+.eodtime.dailyadj]each logtabs; // If appropriate, roll error log @@ -294,6 +301,6 @@ init:{[dbname] // exit before logs are touched if process is an sctp NOT in create mode if[.sctp.chainedtp and not .sctp.loggingmode=`create; :()]; .lg.o[`stpexit;"Closing off log files"]; - .stpm.updmeta[.stplg.multilog][`close;.stpps.t;.z.p]; - .stplg.closelog each .stpps.t; + .stpm.updmeta[.stplg.multilog][`close;.stplg.logtabs;.z.p]; + .stplg.closelog each .stplg.logtabs; }] diff --git a/tests/helperfunctions.q b/tests/helperfunctions.q index b8ad95f21..22ea93402 100644 --- a/tests/helperfunctions.q +++ b/tests/helperfunctions.q @@ -16,6 +16,8 @@ isalive:{[proc] any "q" in' @[system;"pgrep -lf ",proc," -u $USER";" "]}; // Have slightly more fluid handle opening mechanic - update: force it to open a new handle each time gethandle:{[name] - .z.pc exec first w from .servers.SERVERS where procname=name; + .z.pc h:exec first w from .servers.SERVERS where procname=name; + // close the old handle as well: .z.pc only marks it closed, and a process can run out of connections + if[not null h;@[hclose;h;()]]; exec first w from .servers.getservers[`procname;name;()!();1b;1b] }; diff --git a/tests/merge/tplogreplay/settings.q b/tests/merge/tplogreplay/settings.q index 64b063d52..0cc67ea51 100644 --- a/tests/merge/tplogreplay/settings.q +++ b/tests/merge/tplogreplay/settings.q @@ -9,7 +9,7 @@ hdbdir:getenv[`KDBTESTS],"/merge/tplogreplay/testhdb" schemafile:getenv[`KDBTESTS],"/merge/tplogreplay/database.q" tplogdir:getenv[`KDBTESTS],"/merge/tplogreplay/testlogs" processfile:getenv[`KDBCODE],"/processes/tickerlogreplay.q" -testconfig:getenv[`KDBTESTS],"/merge/tplogreplay/treplaysettings.q" +testconfig:getenv[`KDBTESTS],"/merge/tplogreplay/tpreplaysettings.q" // system commands to run tickerlogreplay script with different merge methods colreplay:{system"q torq.q -debug -load ",processfile," ",testconfig," -.replay.tplogdir ",tplogdir," -.replay.hdbdir ",hdbdir," -.replay.schemafile ", schemafile," -.replay.mergemethod col -proctype tickerlogreplay -procname tplogreplay1"}; @@ -20,6 +20,8 @@ hybridreplay:{system"q torq.q -debug -load ",processfile," ",testconfig," -.repl .replay.autoreplay:0b .replay.tplogdir: `$tplogdir .replay.hdbdir: `$hdbdir +// the checks look at .replay.tempdir here, so point it at the temp directory tpreplaysettings.q gives the replay +.replay.tempdir:hsym `$tempdir .replay.schemafile: `$schemafile //dropping the tables that are not replayed by log files needed to get use function for names of stp logs .replay.tablestoreplay:3_tables[] diff --git a/tests/monitor/monitor.csv b/tests/monitor/monitor.csv new file mode 100644 index 000000000..2210f0283 --- /dev/null +++ b/tests/monitor/monitor.csv @@ -0,0 +1,9 @@ +action,ms,bytes,lang,code,repeat,minver,comment +before,0,0,q,.servers.startup[],1,,"Start TorQ connection management" +before,0,0,q,monHandle:gethandle[`monitor1],1,,"Open monitor handle" +true,0,0,q,@[{monHandle"start[]";1b};::;0b],1,,"start runs: .html.wssub subscribes lmchart, a function (it used to stop with 'type)" +run,0,0,q,"monHandle""start[]""",1,,"Call start again, as a refresh of the page does" +true,0,0,q,(1 1 1)~count each monHandle(`.html.w;monsubs),1,,"Calling start twice leaves one subscription each" +true,0,0,q,"all {(-6h=type x 0) and ` ~ x 1} each raze monHandle(`.html.w;monsubs)",1,,"Each subscription is the handle and ` (all syms), as the original wssub registers for a table" +true,0,0,q,"@[{monHandle(`.html.wssub;`);1b};::;0b]",1,,"wssub ` subscribes every value the monitor publishes (it used to stop with 'type)" +true,0,0,q,"0b~@[{monHandle(`.html.wssub;`nosuch);1b};::;0b]",1,,"wssub of a name the monitor does not publish is rejected, as before" diff --git a/tests/monitor/process.csv b/tests/monitor/process.csv new file mode 100644 index 000000000..3ebdaa08a --- /dev/null +++ b/tests/monitor/process.csv @@ -0,0 +1,3 @@ +host,port,proctype,procname,U,localtime,g,T,w,load,startwithall,extras,qcmd +localhost,{KDBBASEPORT}+100,discovery,discovery1,${TORQHOME}/appconfig/passwords/accesslist.txt,1,0,,,${KDBCODE}/processes/discovery.q,1,,q +localhost,{KDBBASEPORT}+101,monitor,monitor1,${TORQHOME}/appconfig/passwords/accesslist.txt,1,0,,,${KDBCODE}/processes/monitor.q,1,,q diff --git a/tests/monitor/run.sh b/tests/monitor/run.sh new file mode 100755 index 000000000..c0d0260a4 --- /dev/null +++ b/tests/monitor/run.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +# Handle command-line arguments +source $KDBTESTS/flagparse.sh + +# Path to test directory +testpath=${KDBTESTS}/monitor + +# Start procs +${TORQHOME}/torq.sh start discovery1 monitor1 -csv ${testpath}/process.csv + +# Start test proc +/usr/bin/rlwrap q ${TORQHOME}/torq.q \ + -proctype test -procname test1 \ + -test ${testpath} \ + -load ${KDBTESTS}/helperfunctions.q ${testpath}/settings.q \ + -testresults ${KDBTESTS}/monitor/results/ \ + -runtime $run \ + -procfile ${testpath}/process.csv \ + $debug $stop $write $quiet + +# Shut down procs +${TORQHOME}/torq.sh stop discovery1 monitor1 -csv ${testpath}/process.csv diff --git a/tests/monitor/settings.q b/tests/monitor/settings.q new file mode 100644 index 000000000..82a716199 --- /dev/null +++ b/tests/monitor/settings.q @@ -0,0 +1,7 @@ +// IPC connection parameters +.servers.CONNECTIONS:`monitor; +.servers.USERPASS:`admin:admin; + +// the monitor's web page calls start on every connection, which subscribes these with .html.wssub +// (heartbeat and logmsg are tables, lmchart is a function) +monsubs:`heartbeat`logmsg`lmchart; diff --git a/tests/stp/batching/defbatch.csv b/tests/stp/batching/defbatch.csv index 44e24d91f..348963417 100644 --- a/tests/stp/batching/defbatch.csv +++ b/tests/stp/batching/defbatch.csv @@ -20,5 +20,6 @@ run,0,0,q,![-11;] each logs,1,,"Replay logs locally" true,0,0,q,(l1+11)~l2:count trade,1,,"Check logs contain both batches" true,0,0,q,(c1+10)~c2:rdbHandle"count trade",1,,"Check first batch was successfully replayed from log" run,0,0,q,stpHandle".z.ts[]",1,,"Resume publication" +run,0,0,q,system "sleep 1",1,,"Give data a chance to publish" true,0,0,q,(c2+1)~rdbHandle"count trade",1,,"Check second batch gets published" after,0,0,q,delete from `trade,1,,"Clear local trade table" \ No newline at end of file diff --git a/tests/stp/chainedeod/eodroutine.csv b/tests/stp/chainedeod/eodroutine.csv index 488042c8a..b480a1da1 100644 --- a/tests/stp/chainedeod/eodroutine.csv +++ b/tests/stp/chainedeod/eodroutine.csv @@ -17,7 +17,7 @@ true,0,0,q,1=counttplogs[`stptest1],1,,"Should be 1 log directory for STP" true,0,0,q,1=counttplogs[`sctptest1],1,,"Should be 1 log directory for SCTP" run,0,0,q,now:.z.p,1,,"Get current time" run,0,0,q,data:stpHandle".stplg.endofdaydata[]",1,,"get data" -run,0,0,q,"stpHandle(`.stplg.stpeod;.eodtime.d;data,(enlist `p)!enlist now)",1,,"Run EoD function on STP" +run,0,0,q,"stpHandle(`.stplg.endofday;.eodtime.d;data,(enlist `p)!enlist now)",1,,"Run EoD function on STP" true,0,0,q,all 0 = sctpHandle"count each `. .stpps.t",1,,"Check tables have been flushed" run,0,0,q,meta2:get .Q.dd[sctpDir1;`stpmeta],1,,"Get meta table from disk" run,0,0,q,stpEod2:stpHandle".eodtime.d",1,,"Get new date on STP" diff --git a/tests/stp/chainedeod/run.sh b/tests/stp/chainedeod/run.sh index 1b1001617..49f39d190 100755 --- a/tests/stp/chainedeod/run.sh +++ b/tests/stp/chainedeod/run.sh @@ -14,10 +14,10 @@ ${TORQHOME}/torq.sh start discovery1 stptest1 sctptest1 rdb1 -csv ${testpath}/pr -proctype test -procname test1 \ -test ${testpath} \ -load ${KDBTESTS}/helperfunctions.q ${testpath}/settings.q \ - -results ${KDBTESTS}/stp/results/ \ + -testresults ${KDBTESTS}/stp/results/ \ -procfile ${testpath}/process.csv \ -runtime $run \ - $debug $stop $quiet + $debug $stop $write $quiet # Shut down procs ${TORQHOME}/torq.sh stop discovery1 stptest1 sctptest1 rdb1 -csv ${testpath}/process.csv diff --git a/tests/stp/chainedeodlognone/run.sh b/tests/stp/chainedeodlognone/run.sh index aec217e51..d9780c621 100755 --- a/tests/stp/chainedeodlognone/run.sh +++ b/tests/stp/chainedeodlognone/run.sh @@ -14,10 +14,10 @@ ${TORQHOME}/torq.sh start discovery1 stptest1 sctptest1 rdb1 -csv ${testpath}/pr -proctype test -procname test1 \ -test ${testpath} \ -load ${KDBTESTS}/helperfunctions.q ${testpath}/settings.q \ - -results ${KDBTESTS}/stp/results/ \ + -testresults ${KDBTESTS}/stp/results/ \ -procfile ${testpath}/process.csv \ -runtime $run \ - $debug $stop $quiet + $debug $stop $write $quiet # Shut down procs ${TORQHOME}/torq.sh stop discovery1 stptest1 sctptest1 rdb1 -csv ${testpath}/process.csv diff --git a/tests/stp/chainedeodlognone/sctplognone.csv b/tests/stp/chainedeodlognone/sctplognone.csv index 5681b9102..981f8e5b8 100644 --- a/tests/stp/chainedeodlognone/sctplognone.csv +++ b/tests/stp/chainedeodlognone/sctplognone.csv @@ -16,7 +16,7 @@ true,0,0,q,all rdbHandle"{count value x} each `trade`quote",1,,"Both trade & quo run,0,0,q,data:stpHandle".stplg.endofdaydata[]",1,,"get data" true,0,0,q,1=counttplogs[`stptest1],1,,"Should be 1 log directory for STP" true,0,0,q,0=counttplogs[`sctptest1],1,,"Should be 0 log directories for SCTP" -run,0,0,q,"stpHandle(`.stplg.stpeod;.eodtime.d;data,(enlist `p)!enlist .z.p)",1,,"Run EoD function on STP" +run,0,0,q,"stpHandle(`.stplg.endofday;.eodtime.d;data,(enlist `p)!enlist .z.p)",1,,"Run EoD function on STP" true,0,0,q,all 0 = sctpHandle"count each `. .stpps.t",1,,"Check tables have been flushed" run,0,0,q,stpEod2:stpHandle".eodtime.d",1,,"Get new date on STP" run,0,0,q,sctpEod2:sctpHandle".eodtime.d",1,,"Get new date on SCTP" diff --git a/tests/stp/chainedlogmodes/eodroutine.csv b/tests/stp/chainedlogmodes/eodroutine.csv index 5fd177e11..291b88620 100644 --- a/tests/stp/chainedlogmodes/eodroutine.csv +++ b/tests/stp/chainedlogmodes/eodroutine.csv @@ -22,7 +22,7 @@ true,0,0,q,all 0=(enlist rdbHandle) @\: (`.tst.endp),1,,"Check the endofperiod f run,0,0,q,sctpHandle".z.exit[0i]",1,,"check that sctp can exit cleanly in parent mode" run,0,0,q,now:.z.p,1,,"Get current time" run,0,0,q,data:stpHandle".stplg.endofdaydata[]",1,,"get data" -run,0,0,q,"stpHandle(`.stplg.stpeod;.eodtime.d;data,(enlist `p)!enlist now)",1,,"Run EoD function on STP" +run,0,0,q,"stpHandle(`.stplg.endofday;.eodtime.d;data,(enlist `p)!enlist now)",1,,"Run EoD function on STP" true,0,0,q,all 0 = sctpHandle"count each `. .stpps.t",1,,"Check tables have been flushed" run,0,0,q,eod2:stpHandle".eodtime.d",1,,"Get new date" true,0,0,q,rdbHandle".tst.eod",1,,"Check EoD was triggered on the sub" @@ -43,7 +43,7 @@ true,0,0,q,all 0 = sctpHandle"count each `. .stpps.t",1,,"Check tables have been true,0,0,q,all 1=(enlist rdbHandle) @\: (`.tst.endp),1,,"Check the endofperiod function has been triggered once on all subs" run,0,0,q,now:.z.p,1,,"Get current time" run,0,0,q,data:stpHandle".stplg.endofdaydata[]",1,,"get data" -run,0,0,q,"stpHandle(`.stplg.stpeod;.eodtime.d;data,(enlist `p)!enlist now)",1,,"Run EoD function on STP" +run,0,0,q,"stpHandle(`.stplg.endofday;.eodtime.d;data,(enlist `p)!enlist now)",1,,"Run EoD function on STP" true,0,0,q,all 0 = sctpHandle"count each `. .stpps.t",1,,"Check tables have been flushed" run,0,0,q,eod2:stpHandle".eodtime.d",1,,"Get new date" true,0,0,q,rdbHandle".tst.eod",1,,"Check EoD was triggered on the sub" diff --git a/tests/stp/chainedlogmodes/run.sh b/tests/stp/chainedlogmodes/run.sh index 5676ca299..746318cff 100755 --- a/tests/stp/chainedlogmodes/run.sh +++ b/tests/stp/chainedlogmodes/run.sh @@ -14,10 +14,10 @@ ${TORQHOME}/torq.sh start discovery1 stp1 sctp1 rdb1 -csv ${testpath}/process.cs -proctype test -procname test1 \ -test ${testpath} \ -load ${KDBTESTS}/helperfunctions.q ${testpath}/settings.q \ - -results ${KDBTESTS}/stp/results/ \ + -testresults ${KDBTESTS}/stp/results/ \ -procfile ${testpath}/process.csv \ -runtime $run \ - $debug $stop $quiet + $debug $stop $write $quiet # Shut down procs ${TORQHOME}/torq.sh stop discovery1 stp1 sctp1 rdb1 -csv ${testpath}/process.csv diff --git a/tests/stp/chainedperiodend/endp.csv b/tests/stp/chainedperiodend/endp.csv index 4f8fc2ca2..76f6b4283 100644 --- a/tests/stp/chainedperiodend/endp.csv +++ b/tests/stp/chainedperiodend/endp.csv @@ -7,20 +7,20 @@ before,0,0,q,sctpHandle".sctp.loggingmode:`create",1,,"Let SCTP create logs" before,0,0,q,sctpHandle(`.stplg.init;testlogdb),1,,"Switch test stplog directory" before,0,0,q,rdbHandles:`all`sym`tab!gethandle each `rdball`rdbsymfilt`rdbonetab,1,,"Get RDB handles" before,0,0,q,(value rdbHandles) @\: (set;`endofperiod;endp),1,,"Set dummy endofperiod function on each sub" -before,0,0,q,tcount:count tabs:sctpHandle".stpps.t",1,,"Get number of tables" +before,0,0,q,tcount:count tabs:sctpHandle".stplg.logtabs",1,,"Get number of tables" before,0,0,q,logperiod:sctpHandle".stplg.multilogperiod",1,,"Get logging period" before,0,0,q,metacount:sctpHandle"count .stpm.metatable",1,,"Get initial table count" -before,0,0,q,mstarts:sctpHandle"neg[count .stpps.t]#exec start from .stpm.metatable",1,,"Get most recent start times" +before,0,0,q,mstarts:sctpHandle"neg[count .stplg.logtabs]#exec start from .stpm.metatable",1,,"Get most recent start times" before,0,0,q,mseq:sctpHandle"exec last seq from .stpm.metatable",1,,"Get most recent sequence number" before,0,0,q,period:`curr`next!sctpHandle".stplg[`currperiod`nextperiod]",1,,"Get current and next roll periods" before,0,0,q,system "sleep 11",1,,"Wait for a full period" -true,0,0,q,all 0 = sctpHandle"count each `. .stpps.t",1,,"Check tables have been flushed" -run,0,0,q,mends:(sctpHandle"neg[2*count .stpps.t]#exec end from .stpm.metatable") except 0Np,1,,"Get previous period end times" +true,0,0,q,all 0 = sctpHandle"count each `. .stplg.logtabs",1,,"Check tables have been flushed" +run,0,0,q,mends:(sctpHandle"neg[2*count .stplg.logtabs]#exec end from .stpm.metatable") except 0Np,1,,"Get previous period end times" run,0,0,q,currlog:sctpHandle"currlog",1,,"Get currlog table" true,0,0,q,all 0=(value rdbHandles) @\: (`.tst.endp),1,,"Check the endofperiod function has been triggered once on all subs" true,0,0,q,(metacount+tcount)~sctpHandle"count .stpm.metatable",1,,"Check that the STP metatable count has increased correctly" true,0,0,q,all 1e6>abs "i"$logperiod-mends-mstarts,1,,"Check that the new metatable periods are within 1 microsec of the stated period" true,0,0,q,(mseq+1h)~sctpHandle"exec last seq from .stpm.metatable",1,,"Check that the sequence number has incremented by 1" -true,0,0,q,tabs~raze sctpHandle"exec neg[count .stpps.t]#tbls from .stpm.metatable",1,,"Check that the correct tables are incremented" +true,0,0,q,tabs~raze sctpHandle"exec neg[count .stplg.logtabs]#tbls from .stpm.metatable",1,,"Check that the correct tables are incremented" true,0,0,q,("T"$-6#string currlog[`trade;`logname])~"t"$period`next,1,,"Check trade log name rolled" after,0,0,q,"system ""rm -rf "",1_string sctpHandle(`.stplg.dldir)",1,,"Delete logs folder" \ No newline at end of file diff --git a/tests/stp/chainedperiodend/run.sh b/tests/stp/chainedperiodend/run.sh index 0a2c08825..0d553355f 100755 --- a/tests/stp/chainedperiodend/run.sh +++ b/tests/stp/chainedperiodend/run.sh @@ -14,10 +14,10 @@ ${TORQHOME}/torq.sh start discovery1 stp1 sctp1 rdball rdbsymfilt rdbonetab -cs -proctype test -procname test1 \ -test ${testpath} \ -load ${KDBTESTS}/helperfunctions.q ${testpath}/settings.q \ - -results ${KDBTESTS}/stp/results/ \ + -testresults ${KDBTESTS}/stp/results/ \ -procfile ${testpath}/process.csv \ -runtime $run \ - $debug $stop $quiet + $debug $stop $write $quiet # Shut down procs ${TORQHOME}/torq.sh stop discovery1 stp1 sctp1 rdball rdbsymfilt rdbonetab -csv ${testpath}/process.csv diff --git a/tests/stp/chainedrecovery/run.sh b/tests/stp/chainedrecovery/run.sh index e2f6cde00..70421021e 100755 --- a/tests/stp/chainedrecovery/run.sh +++ b/tests/stp/chainedrecovery/run.sh @@ -14,10 +14,10 @@ ${TORQHOME}/torq.sh start discovery1 -csv ${testpath}/process.csv -proctype test -procname test1 \ -test ${testpath} \ -load ${KDBTESTS}/helperfunctions.q ${testpath}/settings.q \ - -results ${KDBTESTS}/stp/results/ \ + -testresults ${KDBTESTS}/stp/results/ \ -runtime $run \ -procfile ${testpath}/process.csv \ - $debug $stop $quiet + $debug $stop $write $quiet # Shut down procs ${TORQHOME}/torq.sh stop discovery1 stp1 stptabperiod rdball rdbsymfilt rdbcomplexfilt -csv ${testpath}/process.csv diff --git a/tests/stp/chainedstp/run.sh b/tests/stp/chainedstp/run.sh index 42ce8f968..f87341660 100755 --- a/tests/stp/chainedstp/run.sh +++ b/tests/stp/chainedstp/run.sh @@ -14,7 +14,7 @@ ${TORQHOME}/torq.sh start discovery1 stp1 sctp1 -csv ${KDBTESTS}/stp/chainedstp/ -proctype test -procname test1 \ -test ${testpath} \ -load ${KDBTESTS}/helperfunctions.q ${testpath}/settings.q \ - -results ${KDBTESTS}/stp/results/ \ + -testresults ${KDBTESTS}/stp/results/ \ -runtime $run \ -procfile ${testpath}/process.csv \ $debug $stop $write $quiet diff --git a/tests/stp/custommode/database.q b/tests/stp/custommode/database.q new file mode 100644 index 000000000..2072c52a2 --- /dev/null +++ b/tests/stp/custommode/database.q @@ -0,0 +1,6 @@ +// Schema for this suite: it needs these five tables whatever the application's own schema file defines +quote:([]time:`timestamp$(); sym:`g#`symbol$(); bid:`float$(); ask:`float$(); bsize:`long$(); asize:`long$(); mode:`char$(); ex:`char$(); src:`symbol$()) +trade:([]time:`timestamp$(); sym:`g#`symbol$(); price:`float$(); size:`int$(); stop:`boolean$(); cond:`char$(); ex:`char$();side:`symbol$()) +quote_iex:([]time:`timestamp$(); sym:`g#`symbol$(); bid:`float$(); ask:`float$(); bsize:`long$(); asize:`long$(); mode:`char$(); ex:`char$(); srctime:`timestamp$()) +trade_iex:([]time:`timestamp$(); sym:`g#`symbol$(); price:`float$(); size:`int$(); stop:`boolean$(); cond:`char$(); ex:`char$(); srctime:`timestamp$()) +heartbeat:([]time:`timestamp$(); sym:`symbol$(); procname:`symbol$(); counter:`long$(); pid:`int$(); host:`$(); port:`int$()) diff --git a/tests/stp/custommode/logs.csv b/tests/stp/custommode/logs.csv index cff562d23..8ba5d75a5 100644 --- a/tests/stp/custommode/logs.csv +++ b/tests/stp/custommode/logs.csv @@ -4,7 +4,7 @@ before,0,0,q,.servers.startup[],1,,"Set up connection management" before,0,0,q,system "sleep 2",1,,"Wait for connections" before,0,0,q,stpHandle:gethandle[`stp1],1,,"Get STP handle" before,0,0,q,rdbHandle:gethandle[`rdb1],1,,"Get RDB handle" -before,0,0,q,stpHandle(setenv;`KDBTPLOG;tstlogs),1,,"Change STP logging directory" +before,0,0,q,stpHandle({.stplg.kdbtplog:`$x};tstlogs),1,,"Change STP logging directory" before,0,0,q,stpHandle".stplg.custommode:1_(!).(string `SS;csv) 0: .stplg.customcsv",1,,"Load STP custom settings" before,0,0,q,stpHandle"delete from `currlog",1,,"Clear log table" before,0,0,q,stpHandle(system;"t 0"),1,,"Turn off timer" @@ -13,7 +13,7 @@ before,0,0,q,stpHandle".stplg.init[string .proc.procname]",1,,"Re-initialise STP before,0,0,q,c1:rdbHandle @/: ("count trade";"count quote"),1,,"Get initial RDB counts" before,0,0,q,l1:count each (trade;quote),1,,"Get initial local counts" true,0,0,q,"all (key hsym `$tstlogs) like ""*"",string .z.d",1,,"Check logging directory exists" -true,0,0,q,"6i~(sum/) (key hsym `$tstlogs,""/"",db) like\:/: liketabs",1,,"Check log files exist for all tables" +true,0,0,q,"6=(sum/) (key hsym `$tstlogs,""/"",db) like\:/: liketabs",1,,"Check log files exist for all tables" true,0,0,q,all `trade`trade_iex`quote`quote_iex`heartbeat`segmentederrorlogfile in stpHandle"exec tbl from currlog",1,,"Check all tables in logging table" true,0,0,q,not `logmsg in stpHandle"exec tbl from currlog",1,,"Check logmsg not in logging table" true,0,0,q,all not null stpHandle"exec logname from currlog",1,,"Check all lognames filled" @@ -25,12 +25,12 @@ true,0,0,q,(~/) `hh$(("T"$-6#stpHandle"string currlog[`trade;`logname]");"t"$stp true,0,0,q,stpHandle".stplg.currperiod<.z.p+.eodtime.dailyadj",1,,"Check logging period times" true,0,0,q,stpHandle".stplg.nextperiod>.z.p+.eodtime.dailyadj",1,,"Check logging period times" true,0,0,q,stpHandle".stplg.nextperiod~.stplg.currperiod+.stplg.multilogperiod",1,,"Check logging period times" -run,0,0,q,"stpHandle @/: `.u.upd ,/: ((`trade;testtrade);(`quote;testquote);(`heartbeat;`error))",1,,"Send trade,quote and bad updates to STP" +run,0,0,q,"stpHandle @/: `.u.upd ,/: ((`trade;testtrade);(`quote;testquote);(`heartbeat;enlist`error))",1,,"Send trade,quote and bad updates to STP" run,0,0,q,system "sleep 1",1,,"Wait for updates to publish" run,0,0,q,![-11;] each stpHandle"exec logname from currlog where tbl in `trade`quote`segmentederrorlogfile",1,,"Get log contents" true,0,0,q,(c1+10)~rdbHandle @/: ("count trade";"count quote"),1,,"Check tables updated in the RDB" true,0,0,q,(l1+10)~count each (trade;quote),1,,"Check tables updated correctly in logs" -true,0,0,q,`error~.tst.err,1,,"Check error logs updated" -after,0,0,q,stpHandle(setenv;`KDBTPLOG;deflogs),1,,"Change STP logging directory to default" +true,0,0,q,`error~first .tst.err,1,,"Check error logs updated" +after,0,0,q,stpHandle({.stplg.kdbtplog:`$x};deflogs),1,,"Change STP logging directory to default" after,0,0,q,stpHandle(system;"t 1000"),1,,"Turn on timer" after,0,0,q,"system""rm -r "",tstlogs",1,,"Clear log directory" \ No newline at end of file diff --git a/tests/stp/custommode/metaroll.csv b/tests/stp/custommode/metaroll.csv index 9712d9ad9..0471b7e75 100644 --- a/tests/stp/custommode/metaroll.csv +++ b/tests/stp/custommode/metaroll.csv @@ -1,6 +1,6 @@ action,ms,bytes,lang,code,repeat,minver,comment before,0,0,q,.servers.startup[],1,,"Set up connection management" -before,0,0,q,stpHandle(setenv;`KDBTPLOG;tstlogs),1,,"Change STP logging directory" +before,0,0,q,stpHandle({.stplg.kdbtplog:`$x};tstlogs),1,,"Change STP logging directory" before,0,0,q,stpHandle"delete from `.stpm.metatable",1,,"Delete meta table" before,0,0,q,stpHandle"setup[`defaultbatch]",1,,"Re-init STP" before,0,0,q,stpHandle".stplg.init[string .proc.procname]",1,,"Re-init STP" @@ -37,5 +37,5 @@ true,0,0,q,period[`next]~stpHandle".stplg.currperiod",1,,"Check period rolled co true,0,0,q,all ("T"$-6#'string exec logname from clog where tbl in `trade`heartbeat)="t"$period[`next],1,,"Check trade/heartbeat log names rolled" true,0,0,q,qlog~clog[`quote;`logname],1,,"Check quote log not rolled" true,0,0,q,not (~/) exec logname from clog where tbl in `trade`quote,1,,"Check trade and quote writing to different logs" -after,0,0,q,stpHandle(setenv;`KDBTPLOG;deflogs),1,,"Change STP logging directory to default" +after,0,0,q,stpHandle({.stplg.kdbtplog:`$x};deflogs),1,,"Change STP logging directory to default" after,0,0,q,"system""rm -r "",tstlogs",1,,"Clear log directory" \ No newline at end of file diff --git a/tests/stp/custommode/process.csv b/tests/stp/custommode/process.csv index f7d8ec663..0c5383285 100644 --- a/tests/stp/custommode/process.csv +++ b/tests/stp/custommode/process.csv @@ -1,4 +1,4 @@ host,port,proctype,procname,U,localtime,g,T,w,load,startwithall,extras,qcmd localhost,{KDBBASEPORT}+100,discovery,discovery1,${TORQHOME}/appconfig/passwords/accesslist.txt,1,0,,,${KDBCODE}/processes/discovery.q,1,,q -localhost,{KDBBASEPORT}+101,segmentedtickerplant,stp1,${TORQHOME}/appconfig/passwords/accesslist.txt,1,0,,,${KDBCODE}/processes/segmentedtickerplant.q,1,-schemafile ${TORQHOME}/database.q -.stplg.multilog custom -.stplg.customcsv ${KDBTESTS}/stpcustom.csv,q +localhost,{KDBBASEPORT}+101,segmentedtickerplant,stp1,${TORQHOME}/appconfig/passwords/accesslist.txt,1,0,,,${KDBCODE}/processes/segmentedtickerplant.q,1,-schemafile ${KDBTESTS}/stp/custommode/database.q -.stplg.multilog custom -.stplg.customcsv ${KDBTESTS}/stpcustom.csv,q localhost,{KDBBASEPORT}+102,rdb,rdb1,${TORQHOME}/appconfig/passwords/accesslist.txt,1,1,180,,${KDBCODE}/processes/rdb.q,1,-.rdb.replaylog 0b,q diff --git a/tests/stp/eod/eodroutine.csv b/tests/stp/eod/eodroutine.csv index fc2708984..4cc7c2616 100644 --- a/tests/stp/eod/eodroutine.csv +++ b/tests/stp/eod/eodroutine.csv @@ -6,14 +6,14 @@ before,0,0,q,stpHandle:gethandle[`stp1],1,,"Get STP handle" before,0,0,q,rdbHandle:gethandle[`rdb1],1,,"Get RDB handle" before,0,0,q,rdbHandle"endofday:{[x;y] .tst.eod:1b}",1,,"Overwrite RDB endofday function" before,0,0,q,meta1:stpHandle".stpm.metatable",1,,"Get initial meta table" -before,0,0,q,tcount:count stpHandle".stpps.t",1,,"Get table count" +before,0,0,q,tcount:count stpHandle".stplg.logtabs",1,,"Get table count" before,0,0,q,adj:stpHandle".eodtime.dailyadj",1,,"Get time adjustment" before,0,0,q,eod1:stpHandle".eodtime.d",1,,"Get initial date" before,0,0,q,dir1:stpHandle".stplg.dldir",1,,"Get initial log directory" before,0,0,q,db:stpHandle"string .proc.procname",1,,"Get dbname" run,0,0,q,now:.z.p,1,,"Get current time" run,0,0,q,eoddata: stpHandle".stplg.endofdaydata[]",1,,"Get eod data to send" -run,0,0,q,"stpHandle(`.stplg.stpeod;.eodtime.d;eoddata,(enlist `p)!enlist now)",1,,"Run EoD function on STP" +run,0,0,q,"stpHandle(`.stplg.endofday;.eodtime.d;eoddata,(enlist `p)!enlist now)",1,,"Run EoD function on STP" run,0,0,q,meta2:get .Q.dd[dir1;`stpmeta],1,,"Get meta table from disk" run,0,0,q,eod2:stpHandle".eodtime.d",1,,"Get new date" run,0,0,q,dir2:stpHandle".stplg.dldir",1,,"Get new log directory" diff --git a/tests/stp/idbdefault/idbdefault.csv b/tests/stp/idbdefault/idbdefault.csv index 6c32642be..12d5ffcb8 100644 --- a/tests/stp/idbdefault/idbdefault.csv +++ b/tests/stp/idbdefault/idbdefault.csv @@ -16,7 +16,7 @@ true,0,0,q,neg[gwHandle](`.gw.asyncexec;"select from trade where date=.z.D";`idb run,0,0,q,"stpHandle @/: `.u.upd ,/: ((`trade;testtrade);(`quote;testquote))",1,,"Send trade and quote updates to STP" run,0,0,q,.proc.sys "sleep 3",1,,"Wait for updates to get published" true,0,0,q,"neg[gwHandle](`.gw.asyncexec;""select from trade where date=.z.D, sym=`GOOG"";`idb);5~count gwHandle[]",1,,"Check trade update was correctly published" -true,0,0,q,"neg[gwHandle](`.gw.asyncexec;""select from quote_iex where date=.z.D"";`idb);0~count gwHandle[]",1,,"Check if table that not have been published has 0 rows" +true,0,0,q,"neg[gwHandle](`.gw.asyncexec;""select from packets where date=.z.D"";`idb);0~count gwHandle[]",1,,"Check if table that not have been published has 0 rows" run,0,0,q,wdbHandle(`.u.end;`.wdb.currentpartition),1,,"Trigger EOD on WDB" run,0,0,q,.proc.sys "sleep 3",1,,"Wait for merge to HDB to happen" true,0,0,q,neg[gwHandle](`.gw.asyncexec;"select from trade where sym in `GOOG";`hdb);5~count gwHandle[],1,,"Check if HDB has the merged data" diff --git a/tests/stp/idbpartbyenum/idbenum.csv b/tests/stp/idbpartbyenum/idbenum.csv index 41e563725..7e12457f2 100644 --- a/tests/stp/idbpartbyenum/idbenum.csv +++ b/tests/stp/idbpartbyenum/idbenum.csv @@ -16,7 +16,7 @@ true,0,0,q,neg[gwHandle](`.gw.asyncexec;"select from trade";`idb);0~count gwHand run,0,0,q,"stpHandle @/: `.u.upd ,/: ((`trade;testtrade);(`quote;testquote))",1,,"Send trade and quote updates to STP" run,0,0,q,.proc.sys "sleep 3",1,,"Wait for updates to get published" true,0,0,q,neg[gwHandle](`.gw.asyncexec;"select from trade where int=maptoint[`GOOG]";`idb);5~count gwHandle[],1,,"Check trade update was correctly published and maptoint works" -true,0,0,q,neg[gwHandle](`.gw.asyncexec;"select from quote_iex";`idb);0~count gwHandle[],1,,"Check if table that not have been published has 0 rows" +true,0,0,q,neg[gwHandle](`.gw.asyncexec;"select from packets";`idb);0~count gwHandle[],1,,"Check if table that not have been published has 0 rows" run,0,0,q,wdbHandle(`.u.end;`.wdb.currentpartition),1,,"Trigger EOD on WDB" run,0,0,q,.proc.sys "sleep 3",1,,"Wait for merge to HDB to happen" true,0,0,q,neg[gwHandle](`.gw.asyncexec;"select from trade where sym=`GOOG";`hdb);5~count gwHandle[],1,,"Check if HDB has the merged data" diff --git a/tests/stp/periodend/endp.csv b/tests/stp/periodend/endp.csv index 03cbdc72c..8a4a71690 100644 --- a/tests/stp/periodend/endp.csv +++ b/tests/stp/periodend/endp.csv @@ -4,18 +4,18 @@ before,0,0,q,.servers.startup[],1,,"Get connection management set up" before,0,0,q,stpHandle:gethandle[`stp1],1,,"Get STP handle" before,0,0,q,rdbHandles:`all`sym`tab!gethandle each `rdball`rdbsymfilt`rdbonetab,1,,"Get RDB handles" before,0,0,q,(value rdbHandles) @\: (set;`endofperiod;endp),1,,"Set dummy endofperiod function on each sub" -before,0,0,q,tcount:count tabs:stpHandle".stpps.t",1,,"Get number of tables" +before,0,0,q,tcount:count tabs:stpHandle".stplg.logtabs",1,,"Get number of tables" before,0,0,q,logperiod:stpHandle".stplg.multilogperiod",1,,"Get logging period" before,0,0,q,metacount:stpHandle"count .stpm.metatable",1,,"Get initial table count" -before,0,0,q,mstarts:stpHandle"neg[count .stpps.t]#exec start from .stpm.metatable",1,,"Get most recent start times" +before,0,0,q,mstarts:stpHandle"neg[count .stplg.logtabs]#exec start from .stpm.metatable",1,,"Get most recent start times" before,0,0,q,mseq:stpHandle"exec last seq from .stpm.metatable",1,,"Get most recent sequence number" before,0,0,q,period:`curr`next!stpHandle".stplg[`currperiod`nextperiod]",1,,"Get current and next roll periods" before,0,0,q,system "sleep 11",1,,"Wait for a full period" -run,0,0,q,mends:(stpHandle"neg[2*count .stpps.t]#exec end from .stpm.metatable") except 0Np,1,,"Get previous period end times" +run,0,0,q,mends:(stpHandle"neg[2*count .stplg.logtabs]#exec end from .stpm.metatable") except 0Np,1,,"Get previous period end times" run,0,0,q,currlog:stpHandle"currlog",1,,"Get currlog table" true,0,0,q,all 0=(value rdbHandles) @\: (`.tst.endp),1,,"Check the endofperiod function has been triggered once on all subs" true,0,0,q,(metacount+tcount)~stpHandle"count .stpm.metatable",1,,"Check that the STP metatable count has increased correctly" true,0,0,q,all 1e6>abs "i"$logperiod-mends-mstarts,1,,"Check that the new metatable periods are within 1 microsec of the stated period" true,0,0,q,(mseq+1h)~stpHandle"exec last seq from .stpm.metatable",1,,"Check that the sequence number has incremented by 1" -true,0,0,q,tabs~raze stpHandle"exec neg[count .stpps.t]#tbls from .stpm.metatable",1,,"Check that the correct tables are incremented" +true,0,0,q,tabs~raze stpHandle"exec neg[count .stplg.logtabs]#tbls from .stpm.metatable",1,,"Check that the correct tables are incremented" true,0,0,q,("T"$-6#string currlog[`trade;`logname])~"t"$period`next,1,,"Check trade log name rolled" \ No newline at end of file diff --git a/tests/stp/pubsub/pubsub.csv b/tests/stp/pubsub/pubsub.csv index 7edf841be..bb13d0a47 100644 --- a/tests/stp/pubsub/pubsub.csv +++ b/tests/stp/pubsub/pubsub.csv @@ -39,12 +39,13 @@ run,0,0,q,neg[psHandle](`.stpps.pubclear;`trade),1,,"Call pubclear funtion" true,0,0,q,0~count psHandle(`trade),1,,"Check that trade table has been cleared" run,0,0,q,upd:upsert,1,,"Define upd for sub filter tests" true,0,0,q,0~.tst.upd,1,,"Check that local UPD function has been called" -run,0,0,q,rdbHandle(`.u.sub;`trade;`AAPL`GOOG),1,,"Subscribe to filtered sym list" -run,0,0,q,rdbHandle"test:select from trade where i=(last;i)fby sym",1,,"Define set data to compare filter against" -run,0,0,q,rdbHandle".u.pub[`trade;test]",1,,"Force publish for the filtered list to check it is working as intended" -true,0,0,q,trade~rdbHandle"(select from test where sym in `AAPL`GOOG)",1,,"Check that published filtered sym list is same as select statement" -run,0,0,q,rdbHandle(`.u.sub;`trade;`AAPL`GOOG`MSFT),1,,"Re-subscribe with additional sym in the filtered sym list" +run,0,0,q,psHandle(`.u.sub;`trade;`AAPL`GOOG),1,,"Subscribe to filtered sym list" +run,0,0,q,"psHandle(insert;`trade;(4#.z.p;`AAPL`GOOG`MSFT`IBM;80 90 100 110f;4#50i;4#1b;4#""H"";4#""I"";4#`ask))",1,,"Give the pubsub process trades for four syms" +run,0,0,q,psHandle"test:select from trade where i=(last;i)fby sym",1,,"Define set data to compare filter against" +run,0,0,q,psHandle".u.pub[`trade;test]",1,,"Force publish for the filtered list to check it is working as intended" +true,0,0,q,trade~psHandle"(select from test where sym in `AAPL`GOOG)",1,,"Check that published filtered sym list is same as select statement" +run,0,0,q,psHandle(`.u.sub;`trade;`AAPL`GOOG`MSFT),1,,"Re-subscribe with additional sym in the filtered sym list" run,0,0,q,trade:0#trade,1,,"Empty local trade table to make sure nothing is in it before publishing filtered sym list" -run,0,0,q,rdbHandle".u.pub[`trade;test]",1,,"Force publish filter list again with updated sym list publishing to empty trade table" -true,0,0,q,trade~rdbHandle"(select from test where sym in `AAPL`GOOG`MSFT)",1,,"Check that updated published filtered sym list is same as select statement" +run,0,0,q,psHandle".u.pub[`trade;test]",1,,"Force publish filter list again with updated sym list publishing to empty trade table" +true,0,0,q,trade~psHandle"(select from test where sym in `AAPL`GOOG`MSFT)",1,,"Check that updated published filtered sym list is same as select statement" diff --git a/tests/stp/tz/settings.q b/tests/stp/tz/settings.q index d6c964e41..69b725e33 100644 --- a/tests/stp/tz/settings.q +++ b/tests/stp/tz/settings.q @@ -17,7 +17,8 @@ eodinit:{ if[x in `custom`customoffsetplus`customoffsetminus; dt:"p"$0;doff:"n"$0; adj:("p"$1+.z.d) - .z.p + 00:00:02 + off:(`custom`customoffsetplus`customoffsetminus!(0D00;0D02;-0D02))[x]; - `.tz.t upsert (x;dt;adj;doff;adj;dt); + // timezoneID, gmtDateTime, adjustment, localDateTime (the table lost gmtOffset and dstOffset in #603) + `.tz.t upsert (x;dt;adj;dt); .stplg.nextendUTC:"p"$0 ]; diff --git a/tests/stp/upds/run.sh b/tests/stp/upds/run.sh index 9f35e6194..41cf94097 100755 --- a/tests/stp/upds/run.sh +++ b/tests/stp/upds/run.sh @@ -14,7 +14,7 @@ ${TORQHOME}/torq.sh start discovery1 stp1 -csv ${KDBTESTS}/stp/upds/process.csv -proctype test -procname test1 \ -test ${testpath} \ -load ${KDBTESTS}/helperfunctions.q ${testpath}/settings.q \ - -results ${KDBTESTS}/stp/results/ \ + -testresults ${KDBTESTS}/stp/results/ \ -runtime $run \ -procfile ${testpath}/process.csv \ $debug $stop $write $quiet diff --git a/tests/stp/wdb/partbyenum.csv b/tests/stp/wdb/partbyenum.csv index 2fae50992..c7278d2bc 100644 --- a/tests/stp/wdb/partbyenum.csv +++ b/tests/stp/wdb/partbyenum.csv @@ -26,6 +26,7 @@ run,0,0,q,wdbHandle(`.u.end;`.wdb.currentpartition),1,,"Trigger EOD on WDB" run,0,0,q,.proc.sys "sleep 3",1,,"Wait for merge to HDB to happen" true,0,0,q,(2*count[first testtrade])~hdbHandle "count select from trade",1,,"Check trade in hdb" true,0,0,q,(2*count[first testquote])~hdbHandle "count select from quote",1,,"Check quote in hdb" +true,0,0,q,(::)~wdbHandle(`.save.postreplay;`:/tmp;2026.01.01),1,,"Check the WDB's end-of-day hook .save.postreplay takes (dir;date)" after,0,0,q,kill9proc each ("stpnone";"wdbenum";"hdb1"),1,,"Stop all procs" after,0,0,q,.os.deldir logdir,1,,"Delete test segmented tickerplant logs" after,0,0,q,.os.deldir 1_string temphdbdir,1,,"Delete temp HDB"