Skip to content

Commit d4a880f

Browse files
committed
Make scheduler delay configurable via env
Keep the existing 2000ms default to preserve conservative behavior, while allowing local/container runs to experiment with lower values via UNITTESTING_SCHEDULER_DELAY_MS. In fact, "0" works fine on my local machine.
1 parent 92b8003 commit d4a880f

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

unittesting/scheduler.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,11 @@ def unit_testing_args(self):
9898

9999

100100
def run_scheduler():
101-
# delay schedule initialization and execution
102-
sublime.set_timeout(lambda: Scheduler().run(), 2000)
101+
# Delay schedule execution. In practice, a single queue tick (`0`) seems
102+
# sufficient once Sublime starts draining callbacks.
103+
try:
104+
delay = int(os.environ.get("UNITTESTING_SCHEDULER_DELAY_MS", "2000"))
105+
except ValueError:
106+
delay = 2000
107+
108+
sublime.set_timeout(lambda: Scheduler().run(), delay)

0 commit comments

Comments
 (0)