mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-10-07 02:58:15 +00:00
More unit test kill -9 fixes (#2570)
* More unit test kill -9 fixes * Fix linter warning
This commit is contained in:
parent
8bb3839b4d
commit
352a6b9c75
2 changed files with 21 additions and 10 deletions
|
|
@ -357,6 +357,7 @@ const runUnitTest = async ({ task }: { task: Task }) => {
|
|||
console.log(
|
||||
`${Date.now()} [cli#runUnitTest | ${task.language} / ${task.exercise}] running "${command.join(" ")}"`,
|
||||
)
|
||||
|
||||
const subprocess = execa({ cwd, shell: true, reject: false })`${command}`
|
||||
|
||||
const timeout = setTimeout(async () => {
|
||||
|
|
@ -370,15 +371,21 @@ const runUnitTest = async ({ task }: { task: Task }) => {
|
|||
})
|
||||
})
|
||||
|
||||
if (descendants.length > 0) {
|
||||
try {
|
||||
console.log(
|
||||
`${Date.now()} [cli#runUnitTest | ${task.language} / ${task.exercise}] killing ${descendants.join(" ")}`,
|
||||
)
|
||||
console.log(
|
||||
`${Date.now()} [cli#runUnitTest | ${task.language} / ${task.exercise}] "${command.join(" ")}": ${subprocess.pid} -> ${JSON.stringify(descendants)}`,
|
||||
)
|
||||
|
||||
await execa`kill -9 ${descendants.join(" ")}`
|
||||
} catch (error) {
|
||||
console.error("Error killing descendant processes:", error)
|
||||
if (descendants.length > 0) {
|
||||
for (const descendant of descendants) {
|
||||
try {
|
||||
console.log(
|
||||
`${Date.now()} [cli#runUnitTest | ${task.language} / ${task.exercise}] killing ${descendant}`,
|
||||
)
|
||||
|
||||
await execa`kill -9 ${descendant}`
|
||||
} catch (error) {
|
||||
console.error("Error killing descendant processes:", error)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -386,7 +393,11 @@ const runUnitTest = async ({ task }: { task: Task }) => {
|
|||
`${Date.now()} [cli#runUnitTest | ${task.language} / ${task.exercise}] killing ${subprocess.pid}`,
|
||||
)
|
||||
|
||||
await execa`kill -9 ${subprocess.pid!}`
|
||||
try {
|
||||
await execa`kill -9 ${subprocess.pid!}`
|
||||
} catch (error) {
|
||||
console.error("Error killing process:", error)
|
||||
}
|
||||
}, UNIT_TEST_TIMEOUT)
|
||||
|
||||
const result = await subprocess
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import { sqliteTable, text, real, integer, blob, uniqueIndex } from "drizzle-orm
|
|||
import { relations } from "drizzle-orm"
|
||||
import { createInsertSchema } from "drizzle-zod"
|
||||
|
||||
import { GlobalSettings, RooCodeSettings, exerciseLanguages, rooCodeSettingsSchema } from "@evals/types"
|
||||
import { RooCodeSettings, exerciseLanguages, rooCodeSettingsSchema } from "@evals/types"
|
||||
|
||||
/**
|
||||
* runs
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue