Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
8f695c80
Commit
8f695c80
authored
Apr 11, 2023
by
Edward Thomson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clone: skip timeout tests on WinHTTP
parent
14c820b1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
tests/libgit2/online/clone.c
+16
-0
No files found.
tests/libgit2/online/clone.c
View file @
8f695c80
...
@@ -1218,6 +1218,9 @@ void test_online_clone__sha256(void)
...
@@ -1218,6 +1218,9 @@ void test_online_clone__sha256(void)
void
test_online_clone__connect_timeout_configurable
(
void
)
void
test_online_clone__connect_timeout_configurable
(
void
)
{
{
#ifdef GIT_WINHTTP
cl_skip
();
#else
uint64_t
start
,
finish
;
uint64_t
start
,
finish
;
start
=
git_time_monotonic
();
start
=
git_time_monotonic
();
...
@@ -1229,10 +1232,14 @@ void test_online_clone__connect_timeout_configurable(void)
...
@@ -1229,10 +1232,14 @@ void test_online_clone__connect_timeout_configurable(void)
finish
=
git_time_monotonic
();
finish
=
git_time_monotonic
();
cl_assert
(
finish
-
start
<
1000
);
cl_assert
(
finish
-
start
<
1000
);
#endif
}
}
void
test_online_clone__connect_timeout_default
(
void
)
void
test_online_clone__connect_timeout_default
(
void
)
{
{
#ifdef GIT_WINHTTP
cl_skip
();
#else
/* This test takes ~ 75 seconds on Unix. */
/* This test takes ~ 75 seconds on Unix. */
if
(
!
cl_is_env_set
(
"GITTEST_INVASIVE_SPEED"
))
if
(
!
cl_is_env_set
(
"GITTEST_INVASIVE_SPEED"
))
cl_skip
();
cl_skip
();
...
@@ -1243,10 +1250,14 @@ void test_online_clone__connect_timeout_default(void)
...
@@ -1243,10 +1250,14 @@ void test_online_clone__connect_timeout_default(void)
*/
*/
cl_git_fail_with
(
GIT_TIMEOUT
,
git_clone
(
&
g_repo
,
"http://www.google.com:8000/"
,
"./refused"
,
NULL
));
cl_git_fail_with
(
GIT_TIMEOUT
,
git_clone
(
&
g_repo
,
"http://www.google.com:8000/"
,
"./refused"
,
NULL
));
cl_assert
(
git_error_last
()
&&
strstr
(
git_error_last
()
->
message
,
"timed out"
));
cl_assert
(
git_error_last
()
&&
strstr
(
git_error_last
()
->
message
,
"timed out"
));
#endif
}
}
void
test_online_clone__timeout_configurable_times_out
(
void
)
void
test_online_clone__timeout_configurable_times_out
(
void
)
{
{
#ifdef GIT_WINHTTP
cl_skip
();
#else
git_repository
*
failed_repo
;
git_repository
*
failed_repo
;
if
(
!
_remote_speed_timesout
)
if
(
!
_remote_speed_timesout
)
...
@@ -1256,14 +1267,19 @@ void test_online_clone__timeout_configurable_times_out(void)
...
@@ -1256,14 +1267,19 @@ void test_online_clone__timeout_configurable_times_out(void)
cl_git_fail_with
(
GIT_TIMEOUT
,
git_clone
(
&
failed_repo
,
_remote_speed_timesout
,
"./timedout"
,
NULL
));
cl_git_fail_with
(
GIT_TIMEOUT
,
git_clone
(
&
failed_repo
,
_remote_speed_timesout
,
"./timedout"
,
NULL
));
cl_assert
(
git_error_last
()
&&
strstr
(
git_error_last
()
->
message
,
"timed out"
));
cl_assert
(
git_error_last
()
&&
strstr
(
git_error_last
()
->
message
,
"timed out"
));
#endif
}
}
void
test_online_clone__timeout_configurable_succeeds_slowly
(
void
)
void
test_online_clone__timeout_configurable_succeeds_slowly
(
void
)
{
{
#ifdef GIT_WINHTTP
cl_skip
();
#else
if
(
!
_remote_speed_slow
)
if
(
!
_remote_speed_slow
)
cl_skip
();
cl_skip
();
cl_git_pass
(
git_libgit2_opts
(
GIT_OPT_SET_SERVER_TIMEOUT
,
1000
));
cl_git_pass
(
git_libgit2_opts
(
GIT_OPT_SET_SERVER_TIMEOUT
,
1000
));
cl_git_pass
(
git_clone
(
&
g_repo
,
_remote_speed_slow
,
"./slow-but-successful"
,
NULL
));
cl_git_pass
(
git_clone
(
&
g_repo
,
_remote_speed_slow
,
"./slow-but-successful"
,
NULL
));
#endif
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment