chore: convert timeout to milliseconds in JSR223Variable#5269
chore: convert timeout to milliseconds in JSR223Variable#5269
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates JSR223Variable’s coroutine timeout invocation to wrap the configured timeout value into a Kotlin Duration before calling withTimeout, aiming to clarify/standardize the timeout unit handling for JSR-223 script evaluation.
Changes:
- Import
kotlin.time.Duration.Companion.milliseconds. - Change
withTimeout(timeout)towithTimeout(timeout.milliseconds).
| runCatching { | ||
| runBlocking { | ||
| withTimeout(timeout) { | ||
| withTimeout(timeout.milliseconds) { |
There was a problem hiding this comment.
timeout is already documented/parsed as milliseconds (see KDoc and SimulationModel building it as a raw Long), and withTimeout(timeout: Long) also interprets the value as milliseconds. Switching to withTimeout(timeout.milliseconds) doesn’t actually “convert to milliseconds”; it just wraps the same number in a Duration. If the intent is to treat the YAML timeout as seconds (or any unit other than ms), this line needs an actual conversion (e.g., timeout.seconds or timeout * 1000L) and the KDoc/error message should be updated accordingly; otherwise consider keeping the original call or renaming the parameter to make the unit explicit.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5269 +/- ##
=========================================
Coverage 61.53% 61.53%
Complexity 14 14
=========================================
Files 2 2
Lines 78 78
Branches 4 4
=========================================
Hits 48 48
Misses 24 24
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
206e111 to
e530932
Compare
e530932 to
ea6fe6a
Compare
|



No description provided.