mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 00:57:45 +00:00
test(daemon): pin the sqlite3 prompt in the exec-replaced shell repro (#34468)
sqlite3 3.54+ (macOS 27) prints a styled, versioned prompt instead of `sqlite> `, so the #13767 repro tests timed out waiting for it. Start sqlite3 with `-cmd ".prompt 'sqlite> '"` so the prompt is deterministic on every sqlite3 version. Fixes #27052 Co-authored-by: outof-place <contact@outofplace.space>
This commit is contained in:
@@ -372,10 +372,15 @@ zle -N zle-line-init
|
||||
)
|
||||
|
||||
const sqliteTest = hasZsh && existsSync('/usr/bin/sqlite3') ? it : it.skip
|
||||
// sqlite3 3.54+ defaults to a styled, versioned prompt instead of `sqlite> `.
|
||||
const sqlitePinnedPrompt = `-cmd ".prompt 'sqlite> '"`
|
||||
sqliteTest(
|
||||
'does not treat an exec-replaced readline program as the shell prompt',
|
||||
async () => {
|
||||
const running = await startFixture(zshFixture, 'exec /usr/bin/sqlite3\n')
|
||||
const running = await startFixture(
|
||||
zshFixture,
|
||||
`exec /usr/bin/sqlite3 ${sqlitePinnedPrompt}\n`
|
||||
)
|
||||
try {
|
||||
await waitForOutput(running.subscribe, () => running.output().includes('sqlite> '))
|
||||
await new Promise((resolve) => setTimeout(resolve, 300))
|
||||
@@ -393,7 +398,7 @@ zle -N zle-line-init
|
||||
async () => {
|
||||
const running = await startFixture(
|
||||
zshFixture,
|
||||
'ln -s /usr/bin/sqlite3 "$HOME/zsh" && exec "$HOME/zsh"\n'
|
||||
`ln -s /usr/bin/sqlite3 "$HOME/zsh" && exec "$HOME/zsh" ${sqlitePinnedPrompt}\n`
|
||||
)
|
||||
try {
|
||||
await waitForOutput(running.subscribe, () => running.output().includes('sqlite> '))
|
||||
|
||||
Reference in New Issue
Block a user