git clone intermittently fail for "Encountered end of file" by HTTPS protocol, Could we support SSH protocol
- Dominant language
- HTML
- Stars
- 155
- Forks
- 346
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 36
Description
**Describe the bug**
git clone intermittently fail for "Encountered end of file" by HTTPS
**To Reproduce**
`rm -rf STF ; git clone https://github.com/adoptium/STF.git`

**Additional context**
I change HTTPS to SSH, then git clone always success(on the same machine):

Maybe this issue only occur in CHINA?
So, can we support ssh git?
When the test env USE_GIT_SSH=true, then git clone by ssh protocol.
**patch draft**
```diff
diff --git a/buildenv/jenkins/getDependency b/buildenv/jenkins/getDependency
index c0b925e3..08526af3 100644
--- a/buildenv/jenkins/getDependency
+++ b/buildenv/jenkins/getDependency
@@ -21,8 +21,12 @@ def testBuild() {
sh 'mkdir ${WORKSPACE}/j2sdk-image'
sh 'tar -xzf OpenJDK8U-jdk_x64_linux_hotspot*.gz -C ${WORKSPACE}/j2sdk-image --strip-components 1'
sh '${WORKSPACE}/j2sdk-image/jre/bin/java -version'
- sh 'git clone https://github.com/adoptium/aqa-systemtest'
- sh 'git clone https://github.com/adoptium/STF'
+ def git_prefix = "https://github.com/"
+ if( params.USE_GIT_SSH == "true" ){
+ git_prefix = "git@github.com:"
+ }
+ sh 'git clone ${git_prefix}adoptium/aqa-systemtest'
+ sh 'git clone ${git_prefix}adoptium/STF'
sh 'ant -f ./aqa-systemtest/openjdk.build/build.xml -Djava.home=${WORKSPACE}/j2sdk-image/jre -Dprereqs_root=${WORKSPACE}/systemtest_prereqs configure'
sh 'ant -f ./aqa-systemtest/openjdk.test.mauve/build.xml -Djava.home=${WORKSPACE}/j2sdk-image/jre -Dprereqs_root=${WORKSPACE}/systemtest_prereqs configure'
archiveArtifacts '**/systemtest_prereqs/cvsclient/org-netbeans-lib-cvsclient.jar'
diff --git a/compile.sh b/compile.sh
index 7e9af39a..d28b98db 100755
--- a/compile.sh
+++ b/compile.sh
@@ -14,6 +14,9 @@ if [ $USE_TESTENV_PROPERTIES == true ]; then
testenv_file="./testenv/testenv_zos.properties"
fi
while read line; do
+ if [[ "$USE_GIT_SSH" = "true" ]]; then
+ line=`echo $line | sed "s|https://github.com/|git@github.com:|"`
+ fi
export $line
done <$testenv_file
if [ $JDK_IMPL == "openj9" ] || [ $JDK_IMPL == "ibm" ]; then
diff --git a/external/tomcat/test.sh b/external/tomcat/test.sh
index 385d0923..efb831e2 100644
--- a/external/tomcat/test.sh
+++ b/external/tomcat/test.sh
@@ -16,7 +16,12 @@ source $(dirname "$0")/test_base_functions.sh
#Set up Java to be used by the tomcat test
echo_setup
-git clone -q -b 1.6.x --single-branch https://github.com/apache/apr.git $TEST_HOME/tmp/apr
+git_prefix="https://github.com/"
+if [[ "$USE_GIT_SSH" = "true" ]]; then
+ git_prefix="git@github.com:"
+fi
+
+git clone -q -b 1.6.x --single-branch "${git_prefix}apache/apr.git" $TEST_HOME/tmp/apr
cd $TEST_HOME/tmp/apr
./buildconf
./configure --prefix=$TEST_HOME/tmp/apr-build
@@ -24,7 +29,7 @@ make
make install
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TEST_HOME/tmp/apr-build/lib"
-git clone -q https://github.com/apache/tomcat-native.git $TEST_HOME/tmp/tomcat-native
+git clone -q "${git_prefix}apache/tomcat-native.git" $TEST_HOME/tmp/tomcat-native
cd $TEST_HOME/tmp/tomcat-native/native
sh buildconf --with-apr=$TEST_HOME/tmp/apr
./configure --with-apr=$TEST_HOME/tmp/apr --with-java-home=$JAVA_HOME --with-ssl=yes --prefix=$TEST_HOME/tmp/tomcat-native-build
diff --git a/get.sh b/get.sh
index 96cbb1d6..c20d47a4 100755
--- a/get.sh
+++ b/get.sh
@@ -428,6 +428,9 @@ getTestKitGen()
cd $TESTDIR
if [ "$TKG_REPO" = "" ]; then
TKG_REPO="https://github.com/adoptium/TKG.git"
+ if [ "$USE_GIT_SSH" = "true" ]; then
+ TKG_REPO="git@github.com:adoptium/TKG.git"
+ fi
fi
executeCmdWithRetry "TKG" "git clone -q $TKG_REPO"
@@ -498,6 +501,10 @@ getFunctionalTestMaterial()
then
OPENJ9_BRANCH="-b $OPENJ9_BRANCH"
fi
+ if [ "$USE_GIT_SSH" = "true" ]
+ then
+ OPENJ9_REPO=`echo $OPENJ9_REPO | sed "s|https://github.com/|git@github.com:|"`
+ fi
executeCmdWithRetry "openj9" "git clone --depth 1 $OPENJ9_BRANCH $OPENJ9_REPO"
rt_code=$?
diff --git a/perf/bumbleBench/build.xml b/perf/bumbleBench/build.xml
index 38de1c4f..c47e80ae 100644
--- a/perf/bumbleBench/build.xml
+++ b/perf/bumbleBench/build.xml
@@ -22,6 +22,8 @@
+
+
@@ -29,7 +31,12 @@
-
+
+
+
+
+
+
@@ -37,7 +44,6 @@
-
```
[support-git-ssh.diff.txt](https://github.com/adoptium/aqa-tests/files/8949097/support-git-ssh.diff.txt)
Contributor guide
Research direction
Start by reading the clone sites in buildenv/jenkins/getDependency, compile.sh, external/tomcat/test.sh, get.sh, and perf/bumbleBench/build.xml, then trace how USE_GIT_SSH is supplied from the test environment. Done means all listed GitHub clones use SSH when the setting is true and retain HTTPS behavior otherwise; exercise the relevant build or test entry points to verify both paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, shell
- Domain
- testing-qa, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100