Skip to content

Commit 47ede24

Browse files
authored
feat: add timeout option to test harness (#233)
* Add timeout option to test harness * Update to match stylua
1 parent 06266e7 commit 47ede24

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

lua/plenary/test_harness.lua

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ end
4040

4141
function harness.test_directory(directory, opts)
4242
print "Starting..."
43-
opts = vim.tbl_deep_extend("force", { winopts = { winblend = 3 }, sequential = false, keep_going = true }, opts or {})
43+
opts = vim.tbl_deep_extend("force", {
44+
winopts = { winblend = 3 },
45+
sequential = false,
46+
keep_going = true,
47+
timeout = 50000,
48+
}, opts or {})
4449

4550
local res = {}
4651
if not headless then
@@ -119,7 +124,7 @@ function harness.test_directory(directory, opts)
119124
j:start()
120125
if opts.sequential then
121126
log.debug("... Sequential wait for job number", i)
122-
Job.join(j, 50000)
127+
Job.join(j, opts.timeout)
123128
log.debug("... Completed job number", i)
124129
if j.code ~= 0 then
125130
failure = true
@@ -136,7 +141,7 @@ function harness.test_directory(directory, opts)
136141
end
137142

138143
if not opts.sequential then
139-
table.insert(jobs, 50000)
144+
table.insert(jobs, opts.timeout)
140145
log.debug "... Parallel wait"
141146
Job.join(unpack(jobs))
142147
log.debug "... Completed jobs"

0 commit comments

Comments
 (0)