Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
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
dataplatform
atlas
Commits
ed288a75
Commit
ed288a75
authored
Apr 28, 2019
by
Sarath Subramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3168: Fix intermittent UT failure: KafkaNotificationTest.initNotificationService()
parent
b7af1096
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
KafkaNotificationTest.java
...st/java/org/apache/atlas/kafka/KafkaNotificationTest.java
+26
-1
No files found.
notification/src/test/java/org/apache/atlas/kafka/KafkaNotificationTest.java
View file @
ed288a75
...
...
@@ -40,7 +40,7 @@ public class KafkaNotificationTest {
@BeforeClass
public
void
setup
()
throws
Exception
{
initNotificationService
();
startNotificationServicesWithRetry
();
}
@AfterClass
...
...
@@ -77,6 +77,31 @@ public class KafkaNotificationTest {
consumer
.
close
();
}
// retry starting notification services every 2 mins for total of 20 mins
// running parallel tests will keep the notification service ports occupied, hence retry
void
startNotificationServicesWithRetry
()
throws
Exception
{
long
totalTime
=
0
;
long
sleepTime
=
2
*
60
*
1000
;
// 2 mins
long
maxTime
=
20
*
60
*
1000
;
// 20 mins
while
(
true
)
{
try
{
initNotificationService
();
break
;
}
catch
(
Exception
ex
)
{
cleanUpNotificationService
();
if
(
totalTime
>=
maxTime
)
{
throw
ex
;
}
Thread
.
sleep
(
sleepTime
);
totalTime
=
totalTime
+
sleepTime
;
}
}
}
void
initNotificationService
()
throws
Exception
{
Configuration
applicationProperties
=
ApplicationProperties
.
get
();
...
...
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