Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs525-sp18-g07
spark
Commits
0dcad2ed
Commit
0dcad2ed
authored
11 years ago
by
Kay Ousterhout
Browse files
Options
Downloads
Patches
Plain Diff
Added additional unit test for repeated task failures
parent
dea4677c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/src/test/scala/org/apache/spark/scheduler/cluster/ClusterTaskSetManagerSuite.scala
+28
-1
28 additions, 1 deletion
.../spark/scheduler/cluster/ClusterTaskSetManagerSuite.scala
with
28 additions
and
1 deletion
core/src/test/scala/org/apache/spark/scheduler/cluster/ClusterTaskSetManagerSuite.scala
+
28
−
1
View file @
0dcad2ed
...
@@ -40,6 +40,7 @@ class FakeClusterScheduler(sc: SparkContext, liveExecutors: (String, String)* /*
...
@@ -40,6 +40,7 @@ class FakeClusterScheduler(sc: SparkContext, liveExecutors: (String, String)* /*
val
startedTasks
=
new
ArrayBuffer
[
Long
]
val
startedTasks
=
new
ArrayBuffer
[
Long
]
val
endedTasks
=
new
mutable
.
HashMap
[
Long
,
TaskEndReason
]
val
endedTasks
=
new
mutable
.
HashMap
[
Long
,
TaskEndReason
]
val
finishedManagers
=
new
ArrayBuffer
[
TaskSetManager
]
val
finishedManagers
=
new
ArrayBuffer
[
TaskSetManager
]
val
taskSetsFailed
=
new
ArrayBuffer
[
String
]
val
executors
=
new
mutable
.
HashMap
[
String
,
String
]
++
liveExecutors
val
executors
=
new
mutable
.
HashMap
[
String
,
String
]
++
liveExecutors
...
@@ -63,7 +64,9 @@ class FakeClusterScheduler(sc: SparkContext, liveExecutors: (String, String)* /*
...
@@ -63,7 +64,9 @@ class FakeClusterScheduler(sc: SparkContext, liveExecutors: (String, String)* /*
def
executorLost
(
execId
:
String
)
{}
def
executorLost
(
execId
:
String
)
{}
def
taskSetFailed
(
taskSet
:
TaskSet
,
reason
:
String
)
{}
def
taskSetFailed
(
taskSet
:
TaskSet
,
reason
:
String
)
{
taskSetsFailed
+=
taskSet
.
id
}
}
}
def
removeExecutor
(
execId
:
String
)
:
Unit
=
executors
-=
execId
def
removeExecutor
(
execId
:
String
)
:
Unit
=
executors
-=
execId
...
@@ -270,6 +273,30 @@ class ClusterTaskSetManagerSuite extends FunSuite with LocalSparkContext with Lo
...
@@ -270,6 +273,30 @@ class ClusterTaskSetManagerSuite extends FunSuite with LocalSparkContext with Lo
assert
(
manager
.
resourceOffer
(
"exec1"
,
"host1"
,
1
,
ANY
).
get
.
index
===
0
)
assert
(
manager
.
resourceOffer
(
"exec1"
,
"host1"
,
1
,
ANY
).
get
.
index
===
0
)
}
}
test
(
"repeated failures lead to task set abortion"
)
{
sc
=
new
SparkContext
(
"local"
,
"test"
)
val
sched
=
new
FakeClusterScheduler
(
sc
,
(
"exec1"
,
"host1"
))
val
taskSet
=
createTaskSet
(
1
)
val
clock
=
new
FakeClock
val
manager
=
new
ClusterTaskSetManager
(
sched
,
taskSet
,
clock
)
// Fail the task MAX_TASK_FAILURES times, and check that the task set is aborted
// after the last failure.
(
0
until
manager
.
MAX_TASK_FAILURES
).
foreach
{
index
=>
val
offerResult
=
manager
.
resourceOffer
(
"exec1"
,
"host1"
,
1
,
ANY
)
assert
(
offerResult
!=
None
,
"Expect resource offer on iteration %s to return a task"
.
format
(
index
))
assert
(
offerResult
.
get
.
index
===
0
)
manager
.
handleFailedTask
(
offerResult
.
get
.
taskId
,
TaskState
.
FINISHED
,
Some
(
TaskResultLost
))
if
(
index
<
manager
.
MAX_TASK_FAILURES
)
{
assert
(!
sched
.
taskSetsFailed
.
contains
(
taskSet
.
id
))
}
else
{
assert
(
sched
.
taskSetsFailed
.
contains
(
taskSet
.
id
))
}
}
}
/**
/**
* Utility method to create a TaskSet, potentially setting a particular sequence of preferred
* Utility method to create a TaskSet, potentially setting a particular sequence of preferred
* locations for each task (given as varargs) if this sequence is not empty.
* locations for each task (given as varargs) if this sequence is not empty.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment