Skip to content

Commit fe7834d

Browse files
authored
Fix sporadic test failure in service broker deletion during creation (#5045)
The test was flaky because both create and delete jobs could be enqueued with the same timestamp, making pickup order non-deterministic. When the delete job ran first, the create job failed with ServiceBrokerGone. Fix by setting a higher priority number for the delete job so the create job always runs first.
1 parent 21e1605 commit fe7834d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

spec/request/lifecycle/service_brokers_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@
151151
stub_request(:get, 'http://example.org/my-service-broker-url/v2/catalog').
152152
with(basic_auth: %w[admin password]).
153153
to_return(status: 200, body: catalog, headers: {})
154+
155+
# Both jobs may be enqueued with the same timestamp, making pickup order non-deterministic.
156+
# Give the delete job a higher priority number so the create job always runs first.
157+
TestConfig.config[:jobs][:priorities] = { 'service_broker.delete': 10 }
154158
end
155159

156160
it 'allows deletion during creation' do

0 commit comments

Comments
 (0)