fix record io bug

This commit is contained in:
Dmitry Vasilev
2023-07-15 17:59:58 +03:00
parent e8f41d9659
commit 4118bc63d2
3 changed files with 63 additions and 22 deletions

View File

@@ -3416,4 +3416,28 @@ const y = x()`
'object',
)
}),
test('record io hangs bug', async () => {
patch_builtin(
'fetch',
() => new Promise(resolve => original_setTimeout(resolve, 0))
)
const code = `
const p = fetch('')
Math.random()
await p
`
const i = await test_initial_state_async(code)
assert_equal(i.io_trace.length, 3)
const next_code = `await fetch('')`
const state = await command_input_async(i, next_code, 0)
assert_equal(state.io_trace.length, 2)
patch_builtin('fetch', null)
}),
]