diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-11-10 14:01:16 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-11-13 11:00:56 +0100 |
commit | b26932a62a974ff511762268169f0c20cf2e9852 (patch) | |
tree | 1300c045863367f7848ce75b136c780922f0c055 /configserver/src | |
parent | b8c6d8863002771ef90dd8fc03843ad553a8fced (diff) |
Do a pragmatic retry on failed tenants.
Diffstat (limited to 'configserver/src')
-rw-r--r-- | configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java index 4bd9dddc391..faaa92bbb59 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/DeployTester.java @@ -111,7 +111,14 @@ public class DeployTester { clock); } - public Tenant tenant() { return tenants.defaultTenant(); } + public Tenant tenant() { + Tenant tenant = null; + // TODO Retry since there is some code removing/updating the default tenant which should not be done. + while (tenant == null) { + tenant = tenants.defaultTenant(); + } + return tenant; + } /** Create a model factory for the version of this source*/ public static ModelFactory createModelFactory(Clock clock) { @@ -137,12 +144,8 @@ public class DeployTester { * Do the initial "deploy" with the existing API-less code as the deploy API doesn't support first deploys yet. */ public ApplicationId deployApp(String appName, String vespaVersion, Instant now) { + Tenant tenant = tenant(); - if (tenant == null) { - try { - Thread.sleep(10); - } catch (InterruptedException e) { } - } LocalSession session = tenant.getSessionFactory().createSession(testApp, appName, new TimeoutBudget(clock, Duration.ofSeconds(60))); ApplicationId id = ApplicationId.from(tenant.getName(), ApplicationName.from(appName), InstanceName.defaultName()); PrepareParams.Builder paramsBuilder = new PrepareParams.Builder().applicationId(id); |