Question
Zoltán Mencser · Mar 24, 2022

Errors when using TestCoverage, ':ERROR #5002: ObjectScript error:'

Hello everyone!

When running the command 

do ##class(TestCoverage.Manager).RunTest(,"/nodelete",.userParams)

I now get the following error.

ERROR #5002 : ObjectScript error:  <FUNCTION>zStart+45^%Monitor.System.LineByLine.1  <<==== **FAILED** TestCoverage.Manager:OnBeforeAllTests:::

These tests run fine in Studio. 

Also the TestCoverage works fine on all the other namespaces. So far i'm experienceing this problem on this 1 namespace.

The solution of stopping the LinebyLine monitor doesn't help like in the case of ERROR #6060

Can someone please point me in the right direction?

Product version: IRIS 2021.1
0
0 154
Discussion (9)4
Log in or sign up to continue

Some things that would help diagnose the issue:
write $zv
Modify TestCoverage.Manager to output the following as soon as possible after the error occurs:
write $zu(56,2)

It would also help to know what arguments are being passed to %Monitor.System.LineByLine:Start.

Also would be good to know what's in userParams

I'm calling
TEST-EHR>DO ##class(TestCoverage.Manager).RunTest(,"/nodelete",.tCoverageParams)

my tCoverageParams are the following.  

TEST-EHR>zw tCoverageParams
tCoverageParams("CoverageClasses")=$lb("modul.ehr.host.check.CheckOperation","modul.ehr.host.docadd.EHRAddOrUpdateOperation")
tCoverageParams("CoverageDetail")=3
tCoverageParams("SourceNamespace")="TEST-EHR"
tCoverageParams("Timing")=0

On further review, you get a <FUNCTION> error from trying to start the line-by-line monitor when no routines are selected, and the work around is to change namespace to %SYS, do ^PERFMON, and stop the monitor.

USER>zw ##class(%Monitor.System.LineByLine).Start("","",$job)
"0 "_$lb($lb(5002,"<FUNCTION>zStart+45^%Monitor.System.LineByLine.1",,,,,,,,$lb(,"USER",$lb("$^zStart+45^%Monitor.System.LineByLine.1 +1","X^@ +1"))))/* ERROR #5002: ObjectScript error: <FUNCTION>zStart+45^%Monitor.System.LineByLine.1 */

In terms of using the test coverage tool, you should either put a file named coverage.list in your unit test root or pass the list of classes/routines in userParam as described at https://github.com/intersystems/TestCoverage .

https://github.com/intersystems/TestCoverage/issues/11 covers the bad behavior you've seen and would prevent it going forward. (Subsequent attempts to start the line-by-line monitor will end up hitting error #6060 as described in https://github.com/intersystems/TestCoverage/issues/10 .)

Bad behavior of %Monitor.System.LineByLine reported internally as DP-412988

TEST-EHR 4d1>w $zv
IRIS for UNIX (Red Hat Enterprise Linux for x86-64) 2021.1 (Build 215U) Wed Jun 9 2021 09:48:12 EDT
TEST-EHR 4d1>w $zu(56,2)
$Id: //iris/2021.1.0/kernel/common/src/aclass.c#1 $ 13260 0

I've published TestCoverage 2.1.3 on the Open Exchange / zpm - in the situations leading to this, you'll get a more descriptive error message now and the system won't be left in a bad state.

@Timothy Leavitt , thank you for your help!

After clearing out the cached data from TestCoverage with the 

Do ##class(TestCoverage.Utils).Clear()

command, and Setting the following tCoverageParams subscripts, 

SET tCoverageParams("ProcessIDs") = "*"

SET tCoverageParams("CoverageDetail") = 0

then it works.