From beef0caaf7ae927a905fe93e0173b58b2d160c75 Mon Sep 17 00:00:00 2001 From: Philipp Thun Date: Mon, 20 Apr 2026 13:00:59 +0200 Subject: [PATCH] Fix sporadic test failure in service broker deletion during creation 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. --- spec/request/lifecycle/service_brokers_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/request/lifecycle/service_brokers_spec.rb b/spec/request/lifecycle/service_brokers_spec.rb index 4c37ac2bf44..754f66d2ab9 100644 --- a/spec/request/lifecycle/service_brokers_spec.rb +++ b/spec/request/lifecycle/service_brokers_spec.rb @@ -151,6 +151,10 @@ stub_request(:get, 'http://example.org/my-service-broker-url/v2/catalog'). with(basic_auth: %w[admin password]). to_return(status: 200, body: catalog, headers: {}) + + # Both jobs may be enqueued with the same timestamp, making pickup order non-deterministic. + # Give the delete job a higher priority number so the create job always runs first. + TestConfig.config[:jobs][:priorities] = { 'service_broker.delete': 10 } end it 'allows deletion during creation' do