Fix task cancel test being flaky due to task spawn scheduling

This commit is contained in:
Filip Tibell 2023-01-23 14:09:10 -05:00
parent 547d8f25f3
commit f2c9213e3e
No known key found for this signature in database

View file

@ -16,8 +16,10 @@ assert(not flag, "Cancel should handle non-immediate threads")
local flag2: number = 1 local flag2: number = 1
task.spawn(function() task.spawn(function()
task.wait(0.1)
flag2 = 2 flag2 = 2
task.wait() task.wait(0.2)
flag2 = 3 flag2 = 3
end) end)
task.wait(0.2)
assert(flag2 == 2, "Cancel should properly handle yielding threads") assert(flag2 == 2, "Cancel should properly handle yielding threads")