diff --git a/code/common/eodtime.q b/code/common/eodtime.q index 44bef274e..b7d1fabf7 100644 --- a/code/common/eodtime.q +++ b/code/common/eodtime.q @@ -19,9 +19,11 @@ adjtime:{[p] // function to get time (in UTC) of next roll after UTC timestamp, p getroll:{[p] - z:rolltimeoffset-adjtime[p]; // convert rolltimeoffset from rolltimezone to UTC - z:`timespan$(mod) . "j"$z, 1D; // force time adjust to be between 0D and 1D - ("d"$p) + $[z <= p;z+1D;z] // if past time already today, make it tomorrow + rolltod:`timespan$(mod) . "j"$rolltimeoffset,1D; // roll time of day, in rolltimezone + localp:.tz.lg[rolltimezone;p]; // p in rolltimezone + localroll:("d"$localp)+rolltod; // today's roll, local + localroll:$[localroll<=localp;localroll+1D;localroll]; // if already passed, use tomorrow + .tz.gl[rolltimezone;localroll] // local to UTC, using the offset at the roll time }; // function to determine the date (in rolltimezone) from UTC timestamp, p 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/process.csv b/tests/stp/chainedeod/process.csv index 35146e9a2..03ad7fbc0 100644 --- a/tests/stp/chainedeod/process.csv +++ b/tests/stp/chainedeod/process.csv @@ -1,5 +1,5 @@ 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,stptest1,${TORQHOME}/appconfig/passwords/accesslist.txt,1,0,,,${KDBCODE}/processes/segmentedtickerplant.q,1,-schemafile ${TORQHOME}/database.q,q -localhost,{KDBBASEPORT}+102,segmentedchainedtickerplant,sctptest1,${TORQHOME}/appconfig/passwords/accesslist.txt,1,0,,,${KDBCODE}/processes/segmentedtickerplant.q,1,-parentproctype segmentedtickerplant -.sctp.loggingmode create -.sctp.tickerplantname stptest1,q -localhost,{KDBBASEPORT}+103,rdb,rdb1,${TORQHOME}/appconfig/passwords/accesslist.txt,1,1,180,,${KDBCODE}/processes/rdb.q,1,-.rdb.tickerplanttypes segmentedchainedtickerplant,q +localhost,{KDBBASEPORT}+100,discovery,discovery1,${TORQAPPHOME}/appconfig/passwords/accesslist.txt,1,0,,,${KDBCODE}/processes/discovery.q,1,,q +localhost,{KDBBASEPORT}+101,segmentedtickerplant,stptest1,${TORQAPPHOME}/appconfig/passwords/accesslist.txt,1,0,,,${KDBCODE}/processes/segmentedtickerplant.q,1,-schemafile ${TORQAPPHOME}/database.q,q +localhost,{KDBBASEPORT}+102,segmentedchainedtickerplant,sctptest1,${TORQAPPHOME}/appconfig/passwords/accesslist.txt,1,0,,,${KDBCODE}/processes/segmentedtickerplant.q,1,-parentproctype segmentedtickerplant -.sctp.loggingmode create -.sctp.tickerplantname stptest1,q +localhost,{KDBBASEPORT}+103,rdb,rdb1,${TORQAPPHOME}/appconfig/passwords/accesslist.txt,1,1,180,,${KDBCODE}/processes/rdb.q,1,-.rdb.tickerplanttypes segmentedchainedtickerplant,q diff --git a/tests/stp/chainedeod/run.sh b/tests/stp/chainedeod/run.sh index 1b1001617..11fe2b224 100755 --- a/tests/stp/chainedeod/run.sh +++ b/tests/stp/chainedeod/run.sh @@ -16,6 +16,7 @@ ${TORQHOME}/torq.sh start discovery1 stptest1 sctptest1 rdb1 -csv ${testpath}/pr -load ${KDBTESTS}/helperfunctions.q ${testpath}/settings.q \ -results ${KDBTESTS}/stp/results/ \ -procfile ${testpath}/process.csv \ + -debug \ -runtime $run \ $debug $stop $quiet