What are some strategies to unit test a scheduler?

后端 未结 5 1728
温柔的废话
温柔的废话 2020-12-15 23:05

This post started out as \"What are some common patterns in unit testing multi-threaded code ?\", but I found some other discussions on SO that generally agreed that \"It is

5条回答
  •  情深已故
    2020-12-15 23:40

    you could use a recorder object that record the order, timings and other useful stuff in each unit test of your scheduler. The test is simple:

    1. create a recorder object
    2. configure the schedule
    3. execute a unit test
    4. check that recorder object is "compatible" with the schedule

提交回复
热议问题