Stuck on stage #OW9 but my code doesn’t seem ot be the problem.
When running tests with git the tests keep failing because of a timeout. I get the following logs everytime:
remote: [tester::#OW9] Running tests for Stage #OW9 (Parse torrent file)
remote: [tester::#OW9] Running ./your_bittorrent.sh info /tmp/torrents3491338518/codercat.gif.torrent
remote: [your_program] Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce
remote: [your_program] Length: 2994120
remote: [tester::#OW9] Checking for tracker URL (Tracker URL: http://bittorrent-test-tracker.codecrafters.io/announce)
remote: [tester::#OW9] Tracker URL is correct
remote: [tester::#OW9] Checking for length (Length: 2994120)
remote: [tester::#OW9] Length is correct
remote: [tester::#OW9] Test passed.
remote:
remote: [tester::#MN6] Running tests for Stage #MN6 (Decode bencoded dictionaries)
remote: [tester::#MN6] Running ./your_bittorrent.sh decode de
remote: [tester::#MN6] Expected output: {}
remote: [your_program] {}
remote: [tester::#MN6] Running ./your_bittorrent.sh decode d3:foo6:orange5:helloi52ee
remote: [tester::#MN6] Expected output: {"foo":"orange","hello":52}
remote: [your_program] {"foo":"orange","hello":52}
remote: [tester::#MN6] Running ./your_bittorrent.sh decode d10:inner_dictd4:key16:value14:key2i42e8:list_keyl5:item15:item2i3eeee
remote: [tester::#MN6] Expected output: {"inner_dict":{"key1":"value1","key2":42,"list_key":["item1","item2",3]}}
remote: [your_program] {"inner_dict":{"key1":"value1","key2":42,"list_key":["item1","item2",3]}}
remote: [tester::#MN6] Test passed.
remote:
remote: [tester::#AH1] Running tests for Stage #AH1 (Decode bencoded lists)
remote: [tester::#AH1] Running ./your_bittorrent.sh decode le
remote: [tester::#AH1] Expected output: []
remote: [your_program] []
remote: [tester::#AH1] Running ./your_bittorrent.sh decode l9:blueberryi40ee
remote: [tester::#AH1] Expected output: ["blueberry",40]
remote: [your_program] ["blueberry",40]
remote: [tester::#AH1] Running ./your_bittorrent.sh decode lli40e9:blueberryee
remote: [tester::#AH1] Expected output: [[40,"blueberry"]]
remote: [your_program] [[40,"blueberry"]]
remote: [tester::#AH1] Running ./your_bittorrent.sh decode lli4eei5ee
remote: [tester::#AH1] Expected output: [[4],5]
remote: [tester::#AH1] timed out, test exceeded 10 seconds
remote: [tester::#AH1] Test failed
I’ve tried running the faulty command locally and it works fine.
./your_bittorrent.sh decode lli4eei5ee returns [[4],5] as expected.
I tried measuring the performance of each tested command and none of them take more than ~50ms.
Any insight? My code behaves as expected but seems like the timeout delay for the tests is too short.