Merge branch 'stable-6.5'

* stable-6.5:
  Rerun flaky tests 3 times
  Prepare 6.5.1-SNAPSHOT builds
  JGit v6.5.0.202303070854-r
  Ignore generated org.eclipse.jgit.benchmarks/dependency-reduced-pom.xml
  [sshd] Fix calculation of timeout in AbstractClientProxyConnector
  Silence API error raised for removed BranchRebaseMode#PRESERVE

Change-Id: Ie615980c81371ee26b2395e67e026bbd17422fbd
This commit is contained in:
Matthias Sohn 2023-03-07 16:41:06 +01:00
commit 228e4de484
4 changed files with 20 additions and 13 deletions

View File

@ -30,6 +30,7 @@ build:remote17 --tool_java_runtime_version=remotejdk_17
test --build_tests_only
test --test_output=errors
test --flaky_test_attempts=3
import %workspace%/tools/remote-bazelrc

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
/.project
/org.eclipse.jgit.benchmarks/dependency-reduced-pom.xml
/target
infer-out
bazel-*

View File

@ -27,8 +27,8 @@
public abstract class AbstractClientProxyConnector
implements StatefulProxyConnector {
private static final long DEFAULT_PROXY_TIMEOUT_MILLIS = TimeUnit.SECONDS
.toMillis(30L);
private static final long DEFAULT_PROXY_TIMEOUT_NANOS = TimeUnit.SECONDS
.toNanos(30L);
/** Guards {@link #done} and {@link #bufferedCommands}. */
private final Object lock = new Object();
@ -39,7 +39,7 @@ public abstract class AbstractClientProxyConnector
private AtomicReference<Runnable> unregister = new AtomicReference<>();
private long remainingProxyProtocolTime = DEFAULT_PROXY_TIMEOUT_MILLIS;
private long remainingProxyProtocolTime = DEFAULT_PROXY_TIMEOUT_NANOS;
private long lastProxyOperationTime = 0L;
@ -85,12 +85,12 @@ public AbstractClientProxyConnector(@NonNull InetSocketAddress proxyAddress,
* to initialize for
*/
protected void init(ClientSession session) {
remainingProxyProtocolTime = session.getLongProperty(
long millis = session.getLongProperty(
StatefulProxyConnector.TIMEOUT_PROPERTY,
DEFAULT_PROXY_TIMEOUT_MILLIS);
if (remainingProxyProtocolTime <= 0L) {
remainingProxyProtocolTime = DEFAULT_PROXY_TIMEOUT_MILLIS;
}
0);
remainingProxyProtocolTime = (millis > 0)
? TimeUnit.MILLISECONDS.toNanos(millis)
: DEFAULT_PROXY_TIMEOUT_NANOS;
if (session instanceof JGitClientSession) {
JGitClientSession s = (JGitClientSession) session;
unregister.set(() -> s.setProxyHandler(null));
@ -115,12 +115,9 @@ protected long getTimeout() {
if (last != 0L) {
long elapsed = now - last;
remaining -= elapsed;
if (remaining < 0L) {
remaining = 10L; // Give it grace period.
}
remainingProxyProtocolTime = remaining;
}
remainingProxyProtocolTime = remaining;
return remaining;
return Math.max(remaining / 1_000_000L, 10L); // Give it grace period.
}
/**

View File

@ -50,6 +50,14 @@
</message_arguments>
</filter>
</resource>
<resource path="src/org/eclipse/jgit/lib/BranchConfig.java" type="org.eclipse.jgit.lib.BranchConfig$BranchRebaseMode">
<filter id="372293724">
<message_arguments>
<message_argument value="org.eclipse.jgit.lib.BranchConfig.BranchRebaseMode"/>
<message_argument value="PRESERVE"/>
</message_arguments>
</filter>
</resource>
<resource path="src/org/eclipse/jgit/lib/ConfigConstants.java" type="org.eclipse.jgit.lib.ConfigConstants">
<filter id="1142947843">
<message_arguments>