Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/celox-backend-x86/src/backend/native/mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2298,6 +2298,10 @@ pub struct MFunction {
/// caller passes from a reserved register; `None` for other functions.
pub(crate) frame_window: Option<super::function_unit::FrameWindow>,
/// Physical settle-flag bytes, used only to cluster clean guard paths.
#[cfg_attr(
not(any(target_arch = "x86_64", feature = "cross-codegen")),
allow(dead_code)
)]
pub(crate) settle_flags: Option<std::ops::Range<i32>>,
}

Expand Down
7 changes: 2 additions & 5 deletions scripts/queue-release-pr.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,8 @@ export class GitHubCli {
}
}

function positiveSeconds(name, fallback) {
const raw = process.env[name];
if (raw === undefined) {
return fallback;
}
export function positiveSeconds(name, fallback, env = process.env) {
const raw = env[name] ?? fallback;
const value = Number(raw);
if (!Number.isFinite(value) || value <= 0) {
throw new Error(`${name} must be a positive number`);
Expand Down
11 changes: 11 additions & 0 deletions scripts/queue-release-pr.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,21 @@ import assert from "node:assert/strict";
import test from "node:test";
import {
queueReleasePullRequest,
positiveSeconds,
RELEASE_HEAD,
selectReleasePullRequest,
} from "./queue-release-pr.mjs";

test("queue timing defaults and environment overrides use seconds", () => {
assert.equal(positiveSeconds("TIMEOUT", 60 * 60, {}), 3_600_000);
assert.equal(positiveSeconds("POLL", 15, {}), 15_000);
assert.equal(positiveSeconds("TIMEOUT", 60 * 60, { TIMEOUT: "120" }), 120_000);
assert.equal(positiveSeconds("POLL", 15, { POLL: "0.5" }), 500);
for (const raw of ["", "0", "-1", "NaN", "Infinity", "invalid"]) {
assert.throws(() => positiveSeconds("TIMEOUT", 60 * 60, { TIMEOUT: raw }), /positive number/);
}
});

function pr(overrides = {}) {
return {
id: "PR_1",
Expand Down
Loading