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
f54cff2f
Commit
f54cff2f
authored
5 years ago
by
Sarath Subramanian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-3168: Fix intermittent UT failure: HiveHookIT and ImpalaLineageToolIT
parent
6d71f14a
master
No related merge requests found
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
39 deletions
+46
-39
HiveITBase.java
...ridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
+3
-3
HiveMetastoreBridgeIT.java
...a/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java
+1
-1
HiveHookIT.java
.../src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java
+24
-24
HiveMetastoreHookIT.java
.../java/org/apache/atlas/hive/hook/HiveMetastoreHookIT.java
+6
-5
ImpalaLineageITBase.java
...est/java/org/apache/atlas/impala/ImpalaLineageITBase.java
+9
-3
ImpalaLineageToolIT.java
...est/java/org/apache/atlas/impala/ImpalaLineageToolIT.java
+2
-2
NotificationHookConsumerKafkaTest.java
...atlas/notification/NotificationHookConsumerKafkaTest.java
+1
-1
No files found.
addons/hive-bridge/src/test/java/org/apache/atlas/hive/HiveITBase.java
View file @
f54cff2f
...
...
@@ -224,7 +224,7 @@ public class HiveITBase {
protected
String
assertEntityIsRegistered
(
final
String
typeName
,
final
String
property
,
final
String
value
,
final
HiveHookIT
.
AssertPredicate
assertPredicate
)
throws
Exception
{
waitFor
(
8
0000
,
new
HiveHookIT
.
Predicate
()
{
waitFor
(
10
0000
,
new
HiveHookIT
.
Predicate
()
{
@Override
public
void
evaluate
()
throws
Exception
{
AtlasEntity
.
AtlasEntityWithExtInfo
atlasEntityWithExtInfo
=
atlasClientV2
.
getEntityByAttribute
(
typeName
,
Collections
.
singletonMap
(
property
,
value
));
...
...
@@ -242,7 +242,7 @@ public class HiveITBase {
protected
String
assertEntityIsRegisteredViaGuid
(
String
guid
,
final
HiveHookIT
.
AssertPredicate
assertPredicate
)
throws
Exception
{
waitFor
(
8
0000
,
new
HiveHookIT
.
Predicate
()
{
waitFor
(
10
0000
,
new
HiveHookIT
.
Predicate
()
{
@Override
public
void
evaluate
()
throws
Exception
{
AtlasEntity
.
AtlasEntityWithExtInfo
atlasEntityWithExtInfo
=
atlasClientV2
.
getEntityByGuid
(
guid
);
...
...
@@ -373,7 +373,7 @@ public class HiveITBase {
protected
void
assertEntityIsNotRegistered
(
final
String
typeName
,
final
String
property
,
final
String
value
)
throws
Exception
{
// wait for sufficient time before checking if entity is not available.
long
waitTime
=
2
000
;
long
waitTime
=
10
000
;
LOG
.
debug
(
"Waiting for {} msecs, before asserting entity is not registered."
,
waitTime
);
Thread
.
sleep
(
waitTime
);
...
...
This diff is collapsed.
Click to expand it.
addons/hive-bridge/src/test/java/org/apache/atlas/hive/bridge/HiveMetastoreBridgeIT.java
View file @
f54cff2f
...
...
@@ -76,7 +76,7 @@ public class HiveMetastoreBridgeIT extends HiveITBase {
String
tableName
=
tableName
();
String
pFile
=
createTestDFSPath
(
"parentPath"
);
runCommand
(
driverWithoutContext
,
String
.
format
(
"create EXTERNAL table %s(id string) location '%s'"
,
tableName
,
pFile
)
);
runCommand
WithDelay
(
driverWithoutContext
,
String
.
format
(
"create EXTERNAL table %s(id string) location '%s'"
,
tableName
,
pFile
),
3000
);
String
dbId
=
assertDatabaseIsRegistered
(
DEFAULT_DB
);
...
...
This diff is collapsed.
Click to expand it.
addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveHookIT.java
View file @
f54cff2f
This diff is collapsed.
Click to expand it.
addons/hive-bridge/src/test/java/org/apache/atlas/hive/hook/HiveMetastoreHookIT.java
View file @
f54cff2f
...
...
@@ -120,22 +120,22 @@ public class HiveMetastoreHookIT extends HiveITBase {
String
dbName
=
dbName
();
String
query
=
"CREATE DATABASE "
+
dbName
;
runCommand
(
query
);
runCommand
WithDelay
(
query
);
String
dbId
=
assertDatabaseIsRegistered
(
dbName
);
assertEquals
(
getAtlasEntity
(
dbId
).
getStatus
(),
ACTIVE
);
String
table1
=
tableName
();
runCommand
(
"CREATE TABLE "
+
dbName
+
"."
+
table1
+
" (name string, age int, dob date)"
);
runCommand
WithDelay
(
"CREATE TABLE "
+
dbName
+
"."
+
table1
+
" (name string, age int, dob date)"
);
String
table1Id
=
assertTableIsRegistered
(
dbName
,
table1
);
assertEquals
(
getAtlasEntity
(
table1Id
).
getStatus
(),
ACTIVE
);
String
table2
=
tableName
();
runCommand
(
"CREATE TABLE "
+
dbName
+
"."
+
table2
+
" (name string, age int, dob date)"
);
runCommand
WithDelay
(
"CREATE TABLE "
+
dbName
+
"."
+
table2
+
" (name string, age int, dob date)"
);
String
table2Id
=
assertTableIsRegistered
(
dbName
,
table2
);
assertEquals
(
getAtlasEntity
(
table2Id
).
getStatus
(),
ACTIVE
);
query
=
"DROP DATABASE "
+
dbName
+
" CASCADE"
;
runCommand
(
query
);
runCommand
WithDelay
(
query
);
assertDatabaseIsNotRegistered
(
dbName
);
assertEquals
(
getAtlasEntity
(
dbId
).
getStatus
(),
DELETED
);
...
...
@@ -378,7 +378,7 @@ public class HiveMetastoreHookIT extends HiveITBase {
}
protected
void
runCommandWithDelay
(
String
cmd
)
throws
Exception
{
int
delayTimeInMs
=
5
000
;
int
delayTimeInMs
=
10
000
;
runCommandWithDelay
(
driverWithoutContext
,
cmd
,
delayTimeInMs
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
addons/impala-bridge/src/test/java/org/apache/atlas/impala/ImpalaLineageITBase.java
View file @
f54cff2f
...
...
@@ -107,7 +107,7 @@ public class ImpalaLineageITBase {
// return guid of the entity
protected
String
assertEntityIsRegistered
(
final
String
typeName
,
final
String
property
,
final
String
value
,
final
AssertPredicate
assertPredicate
)
throws
Exception
{
waitFor
(
8
0000
,
new
Predicate
()
{
waitFor
(
10
0000
,
new
Predicate
()
{
@Override
public
void
evaluate
()
throws
Exception
{
AtlasEntity
.
AtlasEntityWithExtInfo
atlasEntityWithExtInfo
=
atlasClientV2
.
getEntityByAttribute
(
typeName
,
Collections
...
...
@@ -169,6 +169,8 @@ public class ImpalaLineageITBase {
protected
String
assertProcessIsRegistered
(
List
<
String
>
processQFNames
,
String
queryString
)
throws
Exception
{
try
{
Thread
.
sleep
(
5000
);
LOG
.
debug
(
"Searching for process with query {}"
,
queryString
);
return
assertEntityIsRegistered
(
ImpalaDataType
.
IMPALA_PROCESS
.
getName
(),
processQFNames
,
new
AssertPredicates
()
{
...
...
@@ -194,6 +196,8 @@ public class ImpalaLineageITBase {
protected
String
assertProcessIsRegistered
(
String
processQFName
,
String
queryString
)
throws
Exception
{
try
{
Thread
.
sleep
(
5000
);
LOG
.
debug
(
"Searching for process with qualified name {} and query {}"
,
processQFName
,
queryString
);
return
assertEntityIsRegistered
(
ImpalaDataType
.
IMPALA_PROCESS
.
getName
(),
ATTRIBUTE_QUALIFIED_NAME
,
processQFName
,
new
AssertPredicate
()
{
...
...
@@ -212,6 +216,8 @@ public class ImpalaLineageITBase {
private
String
assertProcessExecutionIsRegistered
(
AtlasEntity
impalaProcess
,
final
String
queryString
)
throws
Exception
{
try
{
Thread
.
sleep
(
5000
);
String
guid
=
""
;
List
<
AtlasObjectId
>
processExecutions
=
toAtlasObjectIdList
(
impalaProcess
.
getRelationshipAttribute
(
BaseImpalaEvent
.
ATTRIBUTE_PROCESS_EXECUTIONS
));
...
...
@@ -334,7 +340,7 @@ public class ImpalaLineageITBase {
}
protected
String
createDatabase
(
String
dbName
)
throws
Exception
{
runCommand
(
"CREATE DATABASE IF NOT EXISTS "
+
dbName
);
runCommand
WithDelay
(
"CREATE DATABASE IF NOT EXISTS "
+
dbName
,
3000
);
return
dbName
;
}
...
...
@@ -349,7 +355,7 @@ public class ImpalaLineageITBase {
}
protected
String
createTable
(
String
dbName
,
String
tableName
,
String
columnsString
,
boolean
isPartitioned
)
throws
Exception
{
runCommand
(
"CREATE TABLE IF NOT EXISTS "
+
dbName
+
"."
+
tableName
+
" "
+
columnsString
+
" comment 'table comment' "
+
(
isPartitioned
?
" partitioned by(dt string)"
:
""
)
);
runCommand
WithDelay
(
"CREATE TABLE IF NOT EXISTS "
+
dbName
+
"."
+
tableName
+
" "
+
columnsString
+
" comment 'table comment' "
+
(
isPartitioned
?
" partitioned by(dt string)"
:
""
),
3000
);
return
dbName
+
"."
+
tableName
;
}
...
...
This diff is collapsed.
Click to expand it.
addons/impala-bridge/src/test/java/org/apache/atlas/impala/ImpalaLineageToolIT.java
View file @
f54cff2f
...
...
@@ -376,10 +376,10 @@ public class ImpalaLineageToolIT extends ImpalaLineageITBase {
toolInstance
.
importHImpalaEntities
(
impalaLineageHook
,
IMPALA
,
IMPALA_WAL
);
// re-run the same lineage record, should have the same process entity and another process execution entity
Thread
.
sleep
(
500
);
Thread
.
sleep
(
500
0
);
IMPALA
=
dir
+
"impalaMultipleInsertIntoAsSelect2.json"
;
toolInstance
.
importHImpalaEntities
(
impalaLineageHook
,
IMPALA
,
IMPALA_WAL
);
Thread
.
sleep
(
3
00
);
Thread
.
sleep
(
50
00
);
// verify the process is saved in Atlas
// the value is from info in IMPALA_4.
...
...
This diff is collapsed.
Click to expand it.
webapp/src/test/java/org/apache/atlas/notification/NotificationHookConsumerKafkaTest.java
View file @
f54cff2f
...
...
@@ -123,7 +123,7 @@ public class NotificationHookConsumerKafkaTest {
reset
(
atlasEntityStore
);
}
@Test
@Test
(
enabled
=
false
)
public
void
consumerConsumesNewMessageButCommitThrowsAnException_MessageOffsetIsRecorded
()
throws
AtlasException
,
InterruptedException
,
AtlasBaseException
{
ExceptionThrowingCommitConsumer
consumer
=
createNewConsumerThatThrowsExceptionInCommit
(
kafkaNotification
,
true
);
...
...
This diff is collapsed.
Click to expand it.
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