• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

RobotWebTools / rclnodejs / 22743178296
86%

Build:
DEFAULT BRANCH: develop
Ran 06 Mar 2026 12:44AM UTC
Jobs 1
Files 50
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

06 Mar 2026 12:31AM UTC coverage: 85.827% (-0.01%) from 85.838%
22743178296

push

github

web-flow
Fix action server goal expiration and correct broken test assertions (#1420)

## fix: action server goal expiration never removed expired goals

### Summary

Fixed two bugs in the action server goal expiration mechanism that caused expired goals to never be removed from memory, and a crash when they were. Also fixed 9 tautological test assertions that masked both bugs, and added deserialized goal info validation to the multi-goal expiration test.

### Bug 1 — Wrong buffer read in `_executeExpiredGoals` (`lib/action/server.js`)

`_executeExpiredGoals()` deserialized goal info from `result.data[i].refObject`, which are JavaScript wrapper objects each with their own empty `_refObject` buffer. The native `rcl_action_expire_goals()` writes into `result._refArray.buffer`, a completely separate memory block. The wrappers never see the native data, so the deserialized UUID was always all-zeros and `_goalHandles.delete(uuid)` never matched — goals were silently never expired.

**Fix:** Changed `goal.refObject` → `result._refArray[i]` to read directly from the native-written buffer.

### Bug 2 — Crash on zero-capacity buffer (`lib/node.js`)

After Bug 1 is fixed, expired goals are actually removed from `_goalHandles`. On the next spin cycle, `isGoalExpired` may still fire with `_goalHandles.size == 0`. Passing a zero-capacity buffer to `rcl_action_expire_goals` violates an RCL precondition and crashes:
> `expired_goals, expired_goals_capacity, and num_expired inconsistent`

**Fix:** Added `if (numGoals > 0)` guard to skip the native call when there are no goal handles.

### Bug 3 — Tautological test assertions (`test/test-action-server.js`)

9 instances of `assert.ok(value, expected)` where `assert.ok`'s second argument is a failure message, not a comparison. These always passed regardless of actual values.

**Fix:** Changed all 9 to `assert.strictEqual(value, expected)`.

### Enhanced test validation (`test/test-action-server.js`)

Added goal info validation t... (continued)

1388 of 1756 branches covered (79.04%)

Branch coverage included in aggregate %.

9 of 9 new or added lines in 2 files covered. (100.0%)

2869 of 3204 relevant lines covered (89.54%)

449.7 hits per line

Jobs
ID Job ID Ran Files Coverage
1 22743178296.1 06 Mar 2026 12:44AM UTC 50
85.83
GitHub Action Run
Source Files on build 22743178296
  • Tree
  • List 50
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #22743178296
  • ba6f9a50 on github
  • Prev Build on develop (#22708647586)
  • Next Build on develop (#22705166217)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc