Revert "[Streaming] fix streaming ci (#9675)" (#10656)

This reverts commit 3645a05644.
This commit is contained in:
SangBin Cho
2020-09-08 19:07:21 -07:00
committed by GitHub
parent 756a9ea641
commit b7040f1310
16 changed files with 75 additions and 177 deletions
+12 -24
View File
@@ -1,10 +1,8 @@
import json
import os
import subprocess
import ray
from ray.streaming import StreamingContext
from ray.test_utils import wait_for_condition
import subprocess
import os
def map_func1(x):
@@ -34,9 +32,9 @@ def test_hybrid_stream():
print("java_worker_options", java_worker_options)
assert not ray.is_initialized()
ray.init(
_load_code_from_local=True,
_include_java=True,
_java_worker_options=java_worker_options,
load_code_from_local=True,
include_java=True,
java_worker_options=java_worker_options,
_system_config={"num_workers_per_process_java": 1})
sink_file = "/tmp/ray_streaming_test_hybrid_stream.txt"
@@ -47,7 +45,6 @@ def test_hybrid_stream():
print("HybridStreamTest", x)
with open(sink_file, "a") as f:
f.write(str(x))
f.flush()
ctx = StreamingContext.Builder().build()
ctx.from_values("a", "b", "c") \
@@ -57,23 +54,14 @@ def test_hybrid_stream():
.as_python_stream() \
.sink(sink_func)
ctx.submit("HybridStreamTest")
def check_succeed():
if os.path.exists(sink_file):
import time
time.sleep(3) # Wait all data be written
with open(sink_file, "r") as f:
result = f.read()
assert "a" in result
assert "b" not in result
assert "c" in result
print("Execution succeed")
return True
return False
wait_for_condition(check_succeed, timeout=60, retry_interval_ms=1000)
print("Execution succeed")
import time
time.sleep(3)
ray.shutdown()
with open(sink_file, "r") as f:
result = f.read()
assert "a" in result
assert "b" not in result
assert "c" in result
if __name__ == "__main__":