We were calling unitCostForComponent on every iteration of metrics, which potentially was causing a flaky test. This moves the call to unitCostForComponent to after generating the entire componentsMap, and has not resulted in a single failed test(100's of runs).
We were calling unitCostForComponent on every iteration of metrics, which potentially was causing a flaky test. This moves the call to unitCostForComponent to after generating the entire componentsMap, and has not resulted in a single failed test(100's of runs).