File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -210,10 +210,18 @@ ClassMethod DeleteHistoryGlobally(
210210 set ns = rs .%Get (" Nsp" )
211211 set $namespace = ns
212212 if ##class (%Dictionary.ClassDefinition ).%Exists ($listbuild (" %IPM.General.History" )) {
213- set subcount = ..DeleteHistory (.filter )
214- set count = count + subcount
215- if verbose {
216- write !, " Deleted " _ subcount _ " record(s) from " _ ns , !
213+ // Use try/catch to handle permission errors in locked-down namespaces
214+ try {
215+ set subcount = ..DeleteHistory (.filter )
216+ set count = count + subcount
217+ if verbose {
218+ write !, " Deleted " _ subcount _ " record(s) from " _ ns , !
219+ }
220+ } catch ex {
221+ // Ignore permission errors in locked namespaces
222+ if verbose {
223+ write !, " Skipped " _ ns _ " (no permission): " _ ex .DisplayString (), !
224+ }
217225 }
218226 }
219227 }
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ Method PersistToTwin() As %Status
5151 set ..PersistedTwin .Phases = ..Phases
5252 // Mark as finalized and record should be locked
5353 set ..PersistedTwin .Finalized = 1
54+ // Ensure the persisted twin is saved (automatically included by saving this temp object)
5455 set sc = ..%Save ()
5556 }
5657 }
Original file line number Diff line number Diff line change @@ -100,6 +100,12 @@ ClassMethod GetAllTestsStatus(
100100 if (failureCount > 0 ) {
101101 set sc = $$$ERROR($$$GeneralError, failureCount _" assertion(s) failed." )
102102 }
103+
104+ // Only clean up AllResults at top level (startIndex=0), not in nested phases
105+ if (startIndex = 0 ) {
106+ kill ^||%UnitTest .Manager .AllResults
107+ kill ^||%UnitTest .Manager .AllResultsCount
108+ }
103109 } catch e {
104110 set sc = e .AsStatus ()
105111 }
@@ -123,11 +129,6 @@ ClassMethod OutputFailures(startIndex As %Integer = 0)
123129 }
124130 }
125131
126- // Only clean up AllResults at top level (startIndex=0), not in nested phases
127- if (startIndex = 0 ) {
128- kill ^||%UnitTest .Manager .AllResults
129- kill ^||%UnitTest .Manager .AllResultsCount
130- }
131132 } catch e {
132133 set sc = e .AsStatus ()
133134 }
You can’t perform that action at this time.
0 commit comments