Skip to content
Permalink
Browse files
[JENKINS-26719] The delay for endview now applies as well for rmview
commands.
  • Loading branch information
Vlatombe committed Mar 31, 2015
1 parent 71d6029 commit 322ca3bf4f4ef69a0fcf75d534382ece152b2f51
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
@@ -77,7 +77,7 @@ public abstract class ClearToolExec implements ClearTool {

protected ClearToolLauncher launcher;
protected String optionalMkviewParameters;
protected int endViewDelay;
protected int endOrRmViewDelay;

protected String updtFileName;
protected VariableResolver<String> variableResolver;
@@ -88,11 +88,11 @@ public ClearToolExec(VariableResolver<String> variableResolver, ClearToolLaunche
this(variableResolver, launcher, optionalMkviewParameters, 0);
}

public ClearToolExec(VariableResolver<String> variableResolver, ClearToolLauncher launcher, String optionalMkviewParameters, int endViewDelay) {
public ClearToolExec(VariableResolver<String> variableResolver, ClearToolLauncher launcher, String optionalMkviewParameters, int endOrRmViewDelay) {
this.variableResolver = variableResolver;
this.launcher = launcher;
this.optionalMkviewParameters = optionalMkviewParameters;
this.endViewDelay = endViewDelay;
this.endOrRmViewDelay = endOrRmViewDelay;
}

@Override
@@ -249,8 +249,8 @@ private void endView(String viewTag, boolean server) throws IOException, Interru
cmd.add(viewTag);

String output = runAndProcessOutput(cmd, null, null, false, null, true);
if (endViewDelay > 0) {
Thread.sleep(TimeUnit.SECONDS.toMillis(endViewDelay));
if (endOrRmViewDelay > 0) {
Thread.sleep(TimeUnit.SECONDS.toMillis(endOrRmViewDelay));
}
if (output.contains("cleartool: Error")) {
throw new IOException("Failed to end view tag: " + output);
@@ -716,6 +716,9 @@ public void rmview(String viewPath) throws IOException, InterruptedException {
launcher.getListener().getLogger().println("Removing view folder as it was not removed when the view was removed.");
viewFilePath.deleteRecursive();
}
if (endOrRmViewDelay > 0) {
Thread.sleep(TimeUnit.SECONDS.toMillis(endOrRmViewDelay));
}
}

@Override
@@ -731,7 +734,9 @@ public void rmviewtag(String viewTag) throws IOException, InterruptedException {
if (output.contains("cleartool: Error")) {
throw new IOException("Failed to remove view tag: " + output);
}

if (endOrRmViewDelay > 0) {
Thread.sleep(TimeUnit.SECONDS.toMillis(endOrRmViewDelay));
}
}

@Override
@@ -747,7 +752,9 @@ public void rmviewUuid(String viewUuid) throws IOException, InterruptedException
if (output.contains("cleartool: Error")) {
throw new IOException("Failed to remove view: " + output);
}

if (endOrRmViewDelay > 0) {
Thread.sleep(TimeUnit.SECONDS.toMillis(endOrRmViewDelay));
}
}

@Override
@@ -56,7 +56,7 @@
<f:textbox name="clearcase.logmergetimewindow" value="${descriptor.logMergeTimeWindow}"
checkUrl="'${rootURL}/scm/ClearCaseSCM/mandatoryCheck?errorText='+escape('Entering a merge time window is mandatory')+'&amp;value='+escape(this.value)" />
</f:entry>
<f:entry title="Delay after calling endview -server" field="endViewDelay">
<f:entry title="Delay after calling rmview/endview" field="endViewDelay">
<f:textbox/>
</f:entry>
</f:advanced>
@@ -1,6 +1,9 @@
<p>Allows to configure an optional delay (in seconds) applied after any call to cleartool endview -server command. It applies only to snapshot views.</p>
<p>Allows to configure an optional delay (in seconds) applied after any call to cleartool rmview or endview command.</p>

<p>
For more details, please read the <a target="blank" href="https://groups.google.com/d/msg/jenkinsci-users/cWNvmxBf1WI/Z_WHm_ay4VEJ">thread</a>
about this specific issue.
For more details, you can read the following links :
<ul>
<li><a target="blank" href="https://groups.google.com/d/msg/jenkinsci-users/cWNvmxBf1WI/Z_WHm_ay4VEJ">jenkins thread</a></li>
<li><a target="blank" href="https://sdecorner.wordpress.com/2013/05/06/clearcaseerror-when-re-creating-a-view-on-nfs-share/">clearcase error when re-creating a view stored on nfs share</a></li>
</ul>
</p>

0 comments on commit 322ca3b

Please sign in to comment.