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
7a9abb9d
Commit
7a9abb9d
authored
11 years ago
by
Josh Rosen
Browse files
Options
Downloads
Patches
Plain Diff
Fix PySpark unit tests on Python 2.6.
parent
63446f92
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
python/pyspark/tests.py
+8
-5
8 additions, 5 deletions
python/pyspark/tests.py
python/run-tests
+12
-14
12 additions, 14 deletions
python/run-tests
with
20 additions
and
19 deletions
python/pyspark/tests.py
+
8
−
5
View file @
7a9abb9d
...
...
@@ -64,7 +64,7 @@ class TestCheckpoint(PySparkTestCase):
flatMappedRDD
=
parCollection
.
flatMap
(
lambda
x
:
range
(
1
,
x
+
1
))
self
.
assertFalse
(
flatMappedRDD
.
isCheckpointed
())
self
.
assert
IsNon
e
(
flatMappedRDD
.
getCheckpointFile
())
self
.
assert
Tru
e
(
flatMappedRDD
.
getCheckpointFile
()
is
None
)
flatMappedRDD
.
checkpoint
()
result
=
flatMappedRDD
.
collect
()
...
...
@@ -79,13 +79,13 @@ class TestCheckpoint(PySparkTestCase):
flatMappedRDD
=
parCollection
.
flatMap
(
lambda
x
:
[
x
])
self
.
assertFalse
(
flatMappedRDD
.
isCheckpointed
())
self
.
assert
IsNon
e
(
flatMappedRDD
.
getCheckpointFile
())
self
.
assert
Tru
e
(
flatMappedRDD
.
getCheckpointFile
()
is
None
)
flatMappedRDD
.
checkpoint
()
flatMappedRDD
.
count
()
# forces a checkpoint to be computed
time
.
sleep
(
1
)
# 1 second
self
.
assert
IsNotNon
e
(
flatMappedRDD
.
getCheckpointFile
())
self
.
assert
Tru
e
(
flatMappedRDD
.
getCheckpointFile
()
is
not
None
)
recovered
=
self
.
sc
.
_checkpointFile
(
flatMappedRDD
.
getCheckpointFile
())
self
.
assertEquals
([
1
,
2
,
3
,
4
],
recovered
.
collect
())
...
...
@@ -164,9 +164,12 @@ class TestDaemon(unittest.TestCase):
time
.
sleep
(
1
)
# daemon should no longer accept connections
with
self
.
assertRaises
(
EnvironmentError
)
as
trap
:
try
:
self
.
connect
(
port
)
self
.
assertEqual
(
trap
.
exception
.
errno
,
ECONNREFUSED
)
except
EnvironmentError
as
exception
:
self
.
assertEqual
(
exception
.
errno
,
ECONNREFUSED
)
else
:
self
.
fail
(
"
Expected EnvironmentError to be raised
"
)
def
test_termination_stdin
(
self
):
"""
Ensure that daemon and workers terminate when stdin is closed.
"""
...
...
This diff is collapsed.
Click to expand it.
python/run-tests
+
12
−
14
View file @
7a9abb9d
...
...
@@ -26,20 +26,18 @@ cd "$FWDIR/python"
FAILED
=
0
$FWDIR
/pyspark pyspark/rdd.py
FAILED
=
$((
$?
||
$FAILED
))
$FWDIR
/pyspark pyspark/context.py
FAILED
=
$((
$?
||
$FAILED
))
$FWDIR
/pyspark
-m
doctest pyspark/broadcast.py
FAILED
=
$((
$?
||
$FAILED
))
$FWDIR
/pyspark
-m
doctest pyspark/accumulators.py
FAILED
=
$((
$?
||
$FAILED
))
$FWDIR
/pyspark
-m
unittest pyspark.tests
FAILED
=
$((
$?
||
$FAILED
))
rm
-f
unit-tests.log
function
run_test
()
{
$FWDIR
/pyspark
$1
2>&1 |
tee
-a
unit-tests.log
FAILED
=
$((
PIPESTATUS[0]||
$FAILED
))
}
run_test
"pyspark/rdd.py"
run_test
"pyspark/context.py"
run_test
"-m doctest pyspark/broadcast.py"
run_test
"-m doctest pyspark/accumulators.py"
run_test
"pyspark/tests.py"
if
[[
$FAILED
!=
0
]]
;
then
echo
-en
"
\0
33[31m"
# Red
...
...
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