Repository navigation
ATF step timeout type-checks in Fluent but is never emitted to sys_atf_step (SDK 4.11.0)
#118
Unanswered
sonisoft-cnanda
asked this question in
Help and Questions with SDK or Fluent
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
timeoutis accepted on an ATF step in Fluent — it is part ofStandardStepValuesand type-checksagainst a
Duration— but it is never emitted into thesys_atf_steprecord. The built XMLcontains
<timeout/>, the installed step reads0 Seconds, and there is no error or warning atbuild, install or run time.
SDK 4.11.0,
@servicenow/sdk+now-sdk build/now-sdk install.Why this one is worth fixing rather than documenting
Timeout is how an ATF step waits. On a stock instance the field is populated on Server-category
steps in real use, not just client ones — counted on one instance:
Record Query (Deprecated)Record QueryRecord ValidationAssert Text on Page (Custom UI)Field Values ValidationImpersonateCreate a UserRun Server Side ScriptA step authored in Fluent to wait therefore does not wait, and the failure is invisible in the
direction that costs most: the test still builds, still installs, and still passes on a fast
instance. It only misbehaves against a slower instance or a genuinely asynchronous condition, where
it reports a false negative instead of waiting — with nothing at author time indicating the value
went nowhere.
Reproduce
Expected:
<timeout>1970-01-01 00:00:30</timeout>Actual:
<timeout/>— and afternow-sdk installthe step's Timeout shows0 Seconds.Evidence it is the emit, not the input
Durationfails withTS2559: Type 'string' has no properties in common with type 'Duration'. Sotimeoutis on thetyped surface; only the emit drops it.
Durationserialises correctly elsewhere in the same build.wfa.flowLogic.waitForADuration({ durationType: 'explicit_duration', duration: Duration({ seconds: 30 }) })emits
timer_duration = 1970-01-01 00:00:30in the same project and the same build. This looksspecific to the ATF step mapping rather than to
Durationhandling generally.instance side is not at fault.
$overrideis not available as an escape hatch here. Adding$override: { timeout: '1970-01-01 00:00:45' }to the step config fails withTS2353: '$override' does not exist in type ... & StandardStepValues.$overrideis exposed ontop-level API constructors, not on the step config objects inside a
Test(...)body — so thereis currently no way to set this from Fluent at all.
Workaround
Patch the step after install. Fluent already pins each step's sys_id in
keys.ts, so this isdeterministic and repeatable:
Two notes that cost time working this out:
GlideDurationin milliseconds.st.setValue('timeout', 30)stores1970-01-01 00:00:00, silently.now-sdk installdoes not appear to reset the value, but any workaround that livesoutside the app is one more thing to remember at promotion time — which is the argument for
fixing the emit.
Suggested resolution
Emit
timeoutontosys_atf_stepfor every step category that has the field (which is all ofthem — it is defined on
sys_atf_stepitself, not per step config).If the intent is that
timeoutshould not be settable for some step types, then rejecting it atbuild time would be an equally good outcome. The problem is not that it is unsupported; it is
that it is accepted, type-checked, and then silently discarded.
Environment
atf.server.recordQuery; the field is onsys_atf_stepso it should affect everystep type equally.
All reactions