dependencies: Fix a flaky test.
Created by: mpimenov
This test used to rely on map iteration order, now it does not.
Original PR: https://github.com/sourcegraph/sourcegraph/pull/35679 Revert PR: https://github.com/sourcegraph/sourcegraph/pull/35768 This PR: Reverts the revert + fixes the test
Test plan: CI, at least two times.