Fix the wheel test for the cubed speed factor

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
swaitsandClaude Fable 5.2 committed 2026-11-24 06:52:20 -07:00
1 parent c5f0461a4e
commit 7a8afcbe69
1 file changed
+3 -3
+3 -3
View File
@@ -581,9 +581,9 @@ class Core(unittest.TestCase):
self.assertEqual(spins({"slow": [600] * 3, "fast": [10, 10]}).count("fast"), 961) # slow is floored at 0.02: 0.04 against 1
self.assertEqual(spins({"slow": [60, 61, 62], "fast": [10]}).count("fast"), 961) # the speed ratio cubed, floored at 0.02: 2 * 0.02 against 1
self.assertEqual(spins({"fast": [10]}).count("fast"), 333) # slow has no timed jobs: factor 1, table order
self.assertEqual(spins({"slow": [20], "fast": [10]}).count("fast"), 666) # factor 0.25: weights 0.5 and 1
self.assertEqual(name(models.choose(table, "ordinary", rand=lambda: 0.05, speed={"slow": [60], "fast": [10]})), "slow")
self.assertEqual(name(models.choose(table, "ordinary", rand=lambda: 0.06, speed={"slow": [60], "fast": [10]})), "fast")
self.assertEqual(spins({"slow": [20], "fast": [10]}).count("fast"), 800) # factor 0.125: weights 0.25 and 1
self.assertEqual(name(models.choose(table, "ordinary", rand=lambda: 0.03, speed={"slow": [60], "fast": [10]})), "slow")
self.assertEqual(name(models.choose(table, "ordinary", rand=lambda: 0.04, speed={"slow": [60], "fast": [10]})), "fast")
def test_a_much_slower_worker_first_in_the_table_rarely_wins(self):
sys.path.insert(0, REPO)