Skip to content

Conversation

@RajsimmanRavi
Copy link

Fixes #973

Problem

The round_robin_web_test_helpers function was creating 5 test helpers (0-4) but the test expected only 4 items (0-3).

Solution

Updated the function to create 4 test helpers with the correct distribution:

  • 0.th.ooni.org: 10% of traffic
  • 1.th, 2.th, 3.th: 30% each

Changes

  • Adjusted shift calculation: q % 4 + 1q % 3 + 1
  • Changed loop: range(5)range(4)
  • Updated modulo: % 5% 4

Testing

  • ✅ Verified test_round_robin_web_test_helpers passes locally

The function was incorrectly creating 5 test helpers (0-4) when it should only create 4 (0-3) based on the intended distribution:
- 0.th.ooni.org: 10% of traffic
- 1.th, 2.th, 3.th: 30% each

Changes:
- Adjust shift calculation: q % 4 + 1 -> q % 3 + 1
- Use range(4) instead of range(5)
- Use % 4 instead of % 5 for rotation

Fixes ooni#973
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failing test: test_round_robin_web_test_helpers

1 participant