Robot Name tests pass locally but timeout after submission
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 35/100
Research direction
Start with the test_generate_all_robots snippet in the test runner and inspect how the loop tracks generated robot names and the timeout. Confirm the intended count and execution behavior, then verify that the test consistently reaches its expected result without timing out.
Written by the indexing model from the issue text.
Description
def test_generate_all_robots
all_names_count = 26 * 26 * 1000
time_limit = Time.now + 60 # seconds
seen_names = Hash.new(0)
robots = []
while seen_names.size < all_names_count && Time.now < time_limit
robot = Robot.new
seen_names[robot.name] += 1
robots << robot
end
assert_equal all_names_count, robots.size, timeout_message
end
I believe that the while loop here leads to non-deterministic behavior. The amount of robots generated is almost always different than the expected number because the loop uses the length of the seen_names keys and fails to take into consideration the total number of times a name was created
- Dominant language
- Ruby
- Stars
- 6
- Forks
- 12
- Avg merge
- 2h 8m
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from exercism/ruby-test-runner
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
exercism/ruby-test-runner#59 · 8 comments ·
-
x:action/improve x:knowledge/advanced x:module/test-runner x:size/large x:type/coding
Difficulty 5/5 Over a week Newbie friendliness 30/100
exercism/ruby-test-runner#37 · 6 comments ·
All issues in exercism/ruby-test-runner
Similar issues
-
user-reported
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Kong/developer.konghq.com#7316 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
TheOdinProject/curriculum#31408 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
notch8/utk_knapsack#148 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Homebrew/homebrew-cask#288729 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100