Skip to content

Commit bcf1847

Browse files
HanSur94claude
andcommitted
fix(octave): unblock v4.0 Octave tests on stock Octave 11.1
Three Octave-specific issues surfaced from the b675c27 run's Octave job (which had already been failing on main pre-merge from PR #138/#139/#143). 1. **ndjsonDecode_mergeStruct_ (line 120)**: `[out(:).(fB{k})] = deal([])` is the MATLAB-idiomatic broadcast assignment but Octave 11.1 rejects it as "invalid assignment to cs-list outside multiple assignment". Real bug that breaks `ndjsonDecode` on Octave for heterogeneous struct merges. Fix: replace with an explicit for-loop that works in both runtimes. 2. **test_event_log_concurrent**: hits `datetime('now', 'TimeZone', 'UTC')` inside `ClusterIdentity.resolve()` (called transitively via FileLock during `EventLog.append`). Octave 11.1 ships `datetime` only via the optional `datatypes` Forge package, which CI doesn't install. Fix: skip the entire test on Octave with a fprintf SKIP message. 3. **test_mksqlite_extended_codes_probe**: uses `datetime` directly at line 109 to timestamp probe output. Same root cause. Fix: same Octave skip pattern. The 7 other Octave test failures (test_event_pick_mode, test_toolbar, test_fastsense_widget_ylimit_modes, test_time_range_selector, etc.) are inherited from main's PR #138/#139/#143/#144 — they don't pass on main either. Out of scope for this PR. Verified: `mh_style libs/ tests/ examples/` clean across 505 files. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 08b0445 commit bcf1847

3 files changed

Lines changed: 27 additions & 1 deletion

File tree

libs/Concurrency/ndjsonDecode.m

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,15 @@
115115

116116
% Add any fields present in s but missing from the array — set to [] on
117117
% all existing rows so the array remains valid.
118+
%
119+
% NOTE: `[out(:).(fB{k})] = deal([])` is the MATLAB-idiomatic broadcast
120+
% assignment, but Octave 11.1 rejects it as "invalid assignment to cs-list
121+
% outside multiple assignment". The explicit for-loop works in both runtimes.
118122
for k = 1:numel(fB)
119123
if ~isfield(out, fB{k})
120-
[out(:).(fB{k})] = deal([]);
124+
for i = 1:numel(out)
125+
out(i).(fB{k}) = [];
126+
end
121127
end
122128
end
123129

tests/test_event_log_concurrent.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@ function test_event_log_concurrent()
2929

3030
add_concurrency_path_();
3131

32+
% Octave gate: ClusterIdentity.resolve() (called transitively via FileLock
33+
% during EventLog.append) uses `datetime('now','TimeZone','UTC')`, which
34+
% Octave 11.1.0 ships only as a package-level function from the `datatypes`
35+
% Octave Forge package. CI doesn't install that package; tests that hit the
36+
% datetime call abort. Skip the whole test on Octave — MATLAB R2020b+ has
37+
% datetime as a core builtin and exercises every code path here.
38+
if exist('OCTAVE_VERSION', 'builtin')
39+
fprintf(' SKIPPED: Octave detected (test requires MATLAB datetime; install datatypes package and remove this skip to enable).\n');
40+
return;
41+
end
42+
3243
nPassed = 0;
3344

3445
% ---- Test 1: in-process append round-trip ----------------------------

tests/test_mksqlite_extended_codes_probe.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ function test_mksqlite_extended_codes_probe()
2424
'mksqlite is not on the path (which mksqlite is empty).');
2525
end
2626

27+
% Octave gate: the probe records timestamps via `datetime('now')`, which
28+
% Octave 11.1.0 only provides through the optional `datatypes` Forge
29+
% package. CI doesn't install that package; skip on Octave. MATLAB R2020b+
30+
% has datetime as a core builtin.
31+
if exist('OCTAVE_VERSION', 'builtin')
32+
fprintf(' SKIPPED: Octave detected (probe records via datetime; install datatypes package and remove this skip to enable).\n');
33+
return;
34+
end
35+
2736
nPassed = 0;
2837
busyMsg = '';
2938
snapshotMsg = 'NOT_REPRODUCED_IN_PROBE — capture under multi-process stress in Phase 1032';

0 commit comments

Comments
 (0)