This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sobolevn
Recipients sobolevn
Date 2022-02-05.15:50:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1644076210.74.0.445085597972.issue46650@roundup.psfhosted.org>
In-reply-to
Content
Right now there only a single test to ensure `priority` works correctly in `scheduler`: https://github.com/python/cpython/blob/fea7290a0ecee09bbce571d4d10f5881b7ea3485/Lib/test/test_sched.py#L90-L97

It looks like it is not enough. Why?

```
for priority in [1, 2, 3, 4, 5]:
  z = scheduler.enterabs(0.01, priority, fun, (priority,))
scheduler.run()
self.assertEqual(l, [1, 2, 3, 4, 5])
```

This test does not actually test different priorities. It only tests that a direct one works correctly. But, this might be a pure coincidence that numbers match. They are spawned in this particular order.

What if there are equal numbers? Like `[1, 2, 1]`

I propose adding more examples to this test. PR is on its way.
History
Date User Action Args
2022-02-05 15:50:11sobolevnsetrecipients: + sobolevn
2022-02-05 15:50:10sobolevnsetmessageid: <1644076210.74.0.445085597972.issue46650@roundup.psfhosted.org>
2022-02-05 15:50:10sobolevnlinkissue46650 messages
2022-02-05 15:50:10sobolevncreate