Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(ci): recognize stopped shell processes and wait for account panel

Steven Enamakeld92c97ef64cb
diff --git a/app/test/e2e/specs/settings-advanced-config.spec.ts b/app/test/e2e/specs/settings-advanced-config.spec.ts
index 55c9901f3c..bf940c8c32 100644
--- a/app/test/e2e/specs/settings-advanced-config.spec.ts
+++ b/app/test/e2e/specs/settings-advanced-config.spec.ts
@@ -7,6 +7,7 @@ import {
clickLabelContaining,
clickText,
textExists,
+ waitForTestId,
waitForText,
} from '../helpers/element-helpers';
import { resetApp } from '../helpers/reset-app';
@@ -47,7 +48,8 @@ describe('Settings - Advanced Config', function () {
async () => (await browser.execute(() => window.location.hash)) === '#/settings/account',
{ timeout: 15_000, timeoutMsg: 'retired notifications route did not redirect to account' }
);
- await waitForText('Account', 15_000);
+ // The route changes before the account panel's async data has mounted.
+ await waitForTestId('account-profile', 15_000);
await waitForText('Preferences', 15_000);
});
diff --git a/app/test/e2e/specs/settings-channels-permissions.spec.ts b/app/test/e2e/specs/settings-channels-permissions.spec.ts
index 546e87f659..082cb3c7c0 100644
--- a/app/test/e2e/specs/settings-channels-permissions.spec.ts
+++ b/app/test/e2e/specs/settings-channels-permissions.spec.ts
@@ -15,6 +15,7 @@ import { callOpenhumanRpc } from '../helpers/core-rpc';
import {
clickSelector,
getSwitchCheckedByLabel,
+ textExists,
toggleSwitchByLabel,
visibleTextExists,
waitForText,
diff --git a/crates/openhuman-core/src/tools/impl/system/shell_tests_timeout_tests.rs b/crates/openhuman-core/src/tools/impl/system/shell_tests_timeout_tests.rs
index 87bb0e6713..4bb89217d3 100644
--- a/crates/openhuman-core/src/tools/impl/system/shell_tests_timeout_tests.rs
+++ b/crates/openhuman-core/src/tools/impl/system/shell_tests_timeout_tests.rs
@@ -3,6 +3,24 @@
use super::*;
+#[cfg(not(windows))]
+fn process_is_running(pid: i32) -> bool {
+ if unsafe { libc::kill(pid, 0) } != 0 {
+ return false;
+ }
+
+ // A killed orphan can remain as a zombie when a container's PID 1 does
+ // not reap it. It cannot execute, so treat that kernel state as stopped.
+ #[cfg(target_os = "linux")]
+ if let Ok(stat) = std::fs::read_to_string(format!("/proc/{pid}/stat")) {
+ if let Some((_, fields)) = stat.rsplit_once(") ") {
+ return !matches!(fields.split_whitespace().next(), Some("Z" | "X" | "x"));
+ }
+ }
+
+ true
+}
+
/// Exit 124 is what coreutils `timeout` returns when its limit expires. The
/// tool's own deadline did not fire, and the model must be told which one did
/// — otherwise `Command failed (exit code 124) [stdout] ok` reads like a bug.
@@ -99,7 +117,7 @@ async fn the_tools_deadline_kills_the_commands_grandchildren_too() {
.unwrap();
let mut gone = false;
for _ in 0..100 {
- if unsafe { libc::kill(grandchild, 0) } != 0 {
+ if !process_is_running(grandchild) {
gone = true;
break;
}