Skip to content

Commit 05ed08a

Browse files
committed
Fix flaky test in manifest_route_update_spec
Use route_mappings_dataset to defer query and avoid race condition.
1 parent 30045f0 commit 05ed08a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

spec/unit/actions/manifest_route_update_spec.rb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,10 @@ module VCAP::CloudController
6666
it 'updates (or recreates) the route mapping with the new protocol' do
6767
ManifestRouteUpdate.update(app.guid, message, user_audit_info)
6868

69-
route_mappings = app.reload.route_mappings
69+
route_mappings = app.reload.route_mappings_dataset.where(route:)
7070

71-
expect(route_mappings.count).to eq(2)
72-
mapped_route = route_mappings.find { |rm| rm.route == route }
73-
expect(mapped_route.protocol).to eq('http2')
71+
expect(route_mappings.count).to eq(1)
72+
expect(route_mappings.first.protocol).to eq('http2')
7473
end
7574
end
7675
end

0 commit comments

Comments
 (0)