Skip to content

Commit b5185b4

Browse files
FauziAkramppigazzini
authored andcommitted
Update tests_run.mak
1 parent 2c67f26 commit b5185b4

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

server/fishtest/templates/tests_run.mak

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,34 @@
700700

701701
const isRun = ${'true' if is_rerun else 'false'};
702702

703+
function handleLtcSpsaThroughput() {
704+
const ltcTestRadio = document.getElementById("ltc_test");
705+
const spsaRadio = document.getElementById("stop-rule-spsa");
706+
const throughputSelect = document.getElementById("throughput");
707+
if (!ltcTestRadio || !spsaRadio || !throughputSelect) return;
708+
709+
// Non-LTC test selected: leave throughput as already set elsewhere.
710+
if (!ltcTestRadio.checked) return;
711+
712+
if (spsaRadio.checked) {
713+
// Case: LTC + SPSA → set recommended 50% throughput.
714+
if ([...throughputSelect.options].some(o => o.value === "50")) {
715+
throughputSelect.value = "50";
716+
}
717+
return;
718+
}
719+
720+
// Case: LTC without SPSA → restore LTC default from its data-options.
721+
try {
722+
const ltcOptions = JSON.parse(ltcTestRadio.dataset.options || "{}");
723+
if (ltcOptions.throughput) {
724+
throughputSelect.value = ltcOptions.throughput;
725+
}
726+
} catch (_) {
727+
// Malformed/missing data-options: keep current throughput.
728+
}
729+
}
730+
703731
function updateSprtBounds(selectedBounds) {
704732
if (selectedBounds === "custom") {
705733
document
@@ -821,6 +849,7 @@
821849
}
822850

823851
spsaWork();
852+
handleLtcSpsaThroughput();
824853
}
825854
})
826855
);
@@ -839,6 +868,7 @@
839868
document.querySelectorAll("[name=stop-rule]").forEach((btn) =>
840869
btn.addEventListener("click", function () {
841870
stopRule = btn.value;
871+
handleLtcSpsaThroughput();
842872

843873
if (stopRule) {
844874
// Hide all elements that have the class "stop-rule"

0 commit comments

Comments
 (0)