Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
L
libzmq
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
libzmq
Commits
d8851c5c
Unverified
Commit
d8851c5c
authored
Feb 04, 2020
by
Luca Boccassi
Committed by
GitHub
Feb 04, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3807 from sigiesec/fix-test-heartbeats
Problem: intermittent timeouts on test_heartbeats
parents
0a1fc44e
58b63667
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
test_heartbeats.cpp
tests/test_heartbeats.cpp
+4
-2
testutil.cpp
tests/testutil.cpp
+3
-5
testutil.hpp
tests/testutil.hpp
+5
-1
No files found.
tests/test_heartbeats.cpp
View file @
d8851c5c
...
...
@@ -50,7 +50,7 @@ SETUP_TEARDOWN_TESTCONTEXT
static
int
get_monitor_event
(
void
*
monitor_
)
{
for
(
int
i
=
0
;
i
<
2
;
i
++
)
{
for
(
int
i
=
0
;
i
<
10
;
i
++
)
{
// First frame in message contains event number and value
zmq_msg_t
msg
;
TEST_ASSERT_SUCCESS_ERRNO
(
zmq_msg_init
(
&
msg
));
...
...
@@ -417,7 +417,9 @@ void test_setsockopt_heartbeat_ttl_near_zero ()
int
main
(
void
)
{
setup_test_environment
();
// The test cases are very long-running. The default timeout of 60 seconds
// is not always enough.
setup_test_environment
(
90
);
UNITY_BEGIN
();
...
...
tests/testutil.cpp
View file @
d8851c5c
...
...
@@ -215,7 +215,7 @@ void close_zero_linger (void *socket_)
TEST_ASSERT_SUCCESS_ERRNO
(
zmq_close
(
socket_
));
}
void
setup_test_environment
()
void
setup_test_environment
(
int
timeout_seconds_
)
{
#if defined _WIN32
#if defined _MSC_VER
...
...
@@ -228,10 +228,8 @@ void setup_test_environment ()
// abort test after 121 seconds
alarm
(
121
);
#else
#if !defined ZMQ_DISABLE_TEST_TIMEOUT
// abort test after 60 seconds
alarm
(
60
);
#endif
// abort test after timeout_seconds_ seconds
alarm
(
timeout_seconds_
);
#endif
#endif
#if defined __MVS__
...
...
tests/testutil.hpp
View file @
d8851c5c
...
...
@@ -144,7 +144,11 @@ void s_recv_seq (void *socket_, ...);
// Sets a zero linger period on a socket and closes it.
void
close_zero_linger
(
void
*
socket_
);
void
setup_test_environment
(
void
);
// Setups the test environment. Must be called at the beginning of each test
// executable. On POSIX systems, it sets an alarm to the specified number of
// seconds, after which the test will be killed. Set to 0 to disable this
// timeout.
void
setup_test_environment
(
int
timeout_seconds_
=
60
);
// Provide portable millisecond sleep
// http://www.cplusplus.com/forum/unices/60161/
...
...
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