A NoOpTaskScheduler has been added to Spring Framework. We should look at how we can use it to disable scheduled tasks in integration tests (and perhaps at runtime as well) probably via some opt-in mechanism.

Comment From: breader124

Hey, I'd like to start working on this enhancement. Would you be able to assign it to me @wilkinsona?

Comment From: wilkinsona

Thanks for the offer, @breader124, but I don't think we know how we want to implement this one yet. Unfortunately, other higher priority work means that we don't have the cycles to figure that out right now. If you have some time to sketch out some ideas when that would be great, but please be aware that it may be wasted effort if we decide to take a different direction.

Comment From: breader124

I'm happy to help. I'll try to think about possible solutions and will post them here to review when I'm ready

Comment From: breader124

@wilkinsona, I did some investigation and it seems that a reasonable solution would be to introduce spring.task.scheduling.enabled property and based on its value: * create either ThreadPoolTaskScheduler or SimpleAsyncTaskScheduler bean when the new property is not explicitly set to false or when it's missing * create the bean of type NoOpTaskScheduler when the property is explicitly set to false

I also propose to leave the creation of all beans of TaskSchedulerBuilder type when scheduling is disabled. If anyone injects them for any reason, it'd be problematic when they disappear after setting the spring.task.scheduling.enabled to false.

How does it sound to you? Do you see more aspects to consider?

Comment From: breader124

Hey @philwebb, is there any news on the topic?

Comment From: philwebb

@breader124 We discussed the issue and would like to do something in 3.4. We can't really start work on it until 3.3 is out.