mirror of
https://github.com/stablyai/orca.git
synced 2026-10-19 08:03:13 +00:00
fix(ci): stabilize flaky terminal and SFTP tests
This commit is contained in:
@@ -278,14 +278,16 @@ describe('incremental terminal history restore', () => {
|
||||
const firstReplay = reader.detectColdRestore(SESSION_ID)
|
||||
const secondReplay = reader.detectColdRestore(secondSessionId)
|
||||
try {
|
||||
// Drain by yield because awaiting the session that loses the replay-slot race deadlocks.
|
||||
await vi.waitFor(() => expect(pendingYields).toHaveLength(1))
|
||||
|
||||
pendingYields.shift()!()
|
||||
expect((await firstReplay)?.scrollbackAnsi).toContain('😀second')
|
||||
|
||||
await vi.waitFor(() => expect(pendingYields).toHaveLength(1))
|
||||
|
||||
pendingYields.shift()!()
|
||||
expect((await secondReplay)?.scrollbackAnsi).toContain('😀second')
|
||||
|
||||
for (const restore of await Promise.all([firstReplay, secondReplay])) {
|
||||
expect(restore?.scrollbackAnsi).toContain('😀second')
|
||||
}
|
||||
expect(pendingYields).toHaveLength(0)
|
||||
} finally {
|
||||
for (const resume of pendingYields.splice(0)) {
|
||||
|
||||
@@ -160,7 +160,8 @@ function installSftpHandlers(sftp: SFTPWrapper, backingRoot: string, operations:
|
||||
async function startSftpWireServer(backingRoot: string): Promise<SftpWireServer> {
|
||||
const operations: string[] = []
|
||||
const connections = new Set<Connection>()
|
||||
const hostKey = utils.generateKeyPairSync('ed25519').private
|
||||
// Ed25519 keygen can produce an invalid 31-byte key; ECDSA points always start with 0x04.
|
||||
const hostKey = utils.generateKeyPairSync('ecdsa', { bits: 256 }).private
|
||||
const server = new Ssh2Server({ hostKeys: [hostKey] }, (connection) => {
|
||||
connections.add(connection)
|
||||
connection.on('error', () => {})
|
||||
|
||||
Reference in New Issue
Block a user