Skip to content
Merged
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: 2 additions & 2 deletions dashboard/src/viewmodels/__tests__/useTasksVM.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,10 @@ describe("useTasksVM", () => {
{ id: "heartbeat", executor: "shell", description: "Heartbeat", timeout: 60, command: "echo hi" },
];
const schedules: Schedule[] = [
{ task: "heartbeat", hour: 9, minute: 0, weekday: "*" },
{ task: "heartbeat", hour: "*", minute: "*/10", weekday: "*" },
];

const now = new Date("2026-01-30T08:50:00Z");
const now = new Date();

const { result } = renderHook(() => useTasksVM({
fetchTasks: async () => tasks,
Expand Down
18 changes: 12 additions & 6 deletions runner-swift/Tests/RunnerTests/IntegrationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,28 @@ struct IntegrationTests {
let (tempDir, storage) = try await createTempStorage()
defer { cleanup(tempDir) }

// Execute a fast task
// Execute a task that takes long enough to be observed as "running"
let task = Task(
id: "cleanup_test",
executor: .shell,
description: "Cleanup test",
timeout: 60,
command: "echo done",
command: "sleep 2 && echo done",
prompt: nil,
workdir: nil
)

let executor = makeExecutor(storage: storage, tempDir: tempDir)
let result = try await executor.execute(task: task, trigger: "test")

// Task is running
let runningBefore = try await storage.getRunningTasks()

// Poll until the task appears as running (executor spawns a background process)
var runningBefore: [RunSummary] = []
let pollDeadline = Date().addingTimeInterval(3)
while Date() < pollDeadline {
runningBefore = try await storage.getRunningTasks()
if runningBefore.count == 1 { break }
try await _Concurrency.Task.sleep(nanoseconds: 100_000_000) // 100ms
}
#expect(runningBefore.count == 1)

// Wait for completion
Expand Down
Loading