Skip to content

chore: convert timeout to milliseconds in JSR223Variable#5269

Open
DanySK wants to merge 1 commit intomasterfrom
chore/converttimeouttomillisecondsinjsr2
Open

chore: convert timeout to milliseconds in JSR223Variable#5269
DanySK wants to merge 1 commit intomasterfrom
chore/converttimeouttomillisecondsinjsr2

Conversation

@DanySK
Copy link
Copy Markdown
Member

@DanySK DanySK commented Apr 14, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 14, 2026 16:16
@DanySK DanySK enabled auto-merge (squash) April 14, 2026 16:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) to withTimeout(timeout.milliseconds).

runCatching {
runBlocking {
withTimeout(timeout) {
withTimeout(timeout.milliseconds) {
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.53%. Comparing base (6989ce3) to head (ea6fe6a).
⚠️ Report is 1 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@DanySK DanySK force-pushed the chore/converttimeouttomillisecondsinjsr2 branch 4 times, most recently from 206e111 to e530932 Compare April 14, 2026 22:04
@DanySK DanySK force-pushed the chore/converttimeouttomillisecondsinjsr2 branch from e530932 to ea6fe6a Compare April 14, 2026 22:14
@sonarqubecloud
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants