Skip to content

Commit

Permalink
Prevent Double Runs and make run clearer.
Browse files Browse the repository at this point in the history
Prevents clicking a run button while tests are running.
I seem to do this once in a while and get errors about DevicePool
acquire device in use 😅

Also made the progress bar have a background color so it's slightly
clearer that tests are running.
  • Loading branch information
greggman committed Nov 1, 2023
1 parent ab09ed4 commit 0fac55f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/common/runtime/standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,20 @@ function makeTreeNodeHeaderHTML(
.attr('alt', runtext)
.attr('title', runtext)
.on('click', async () => {
if (runDepth > 0) {
showInfo('tests are already running');
return;
}
showInfo('');
console.log(`Starting run for ${n.query}`);
// turn off all run buttons
$('#resultsVis').addClass('disable-run');
const startTime = performance.now();
await runSubtree();
const dt = performance.now() - startTime;
const dtMinutes = dt / 1000 / 60;
// turn on all run buttons
$('#resultsVis').removeClass('disable-run');
console.log(`Finished run: ${dt.toFixed(1)} ms = ${dtMinutes.toFixed(1)} min`);
})
.appendTo(header);
Expand Down
9 changes: 8 additions & 1 deletion standalone/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
width: 100%;
left: 0;
top: 0;
background-color: #000;
background-color: #068;
color: #fff;
align-items: center;
}
Expand All @@ -170,6 +170,13 @@
border-right: 1px solid var(--results-fg-color);
}

/* PS: this does not disable using the keyboard to click */
#resultsVis.disable-run button.leafrun,
#resultsVis.disable-run button.subtreerun {
pointer-events: none;
opacity: 25%;
}

/* tree nodes */

.nodeheader {
Expand Down

0 comments on commit 0fac55f

Please sign in to comment.