diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-04-22 09:15:38 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-04-22 09:18:13 -0700 |
commit | 522e20ef9cff8a7a49322c6442d940aa556222c0 (patch) | |
tree | 71bd0e49581f796649703fb68b8cb71689ad91b5 /tensorflow/core/common_runtime/function_test.cc | |
parent | e1722aa3197b3942add6b9fb78ed50e21af693ff (diff) |
Change refs/unrefs of FLR.
PiperOrigin-RevId: 193843055
Diffstat (limited to 'tensorflow/core/common_runtime/function_test.cc')
-rw-r--r-- | tensorflow/core/common_runtime/function_test.cc | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/tensorflow/core/common_runtime/function_test.cc b/tensorflow/core/common_runtime/function_test.cc index 61b2f0e60f..373fc64007 100644 --- a/tensorflow/core/common_runtime/function_test.cc +++ b/tensorflow/core/common_runtime/function_test.cc @@ -231,19 +231,8 @@ class FunctionLibraryRuntimeTest : public ::testing::Test { return status; } FunctionLibraryRuntime::Options opts; - status = Run(flr, handle, opts, args, rets, add_runner); - if (!status.ok()) return status; - - // Release the handle and try running again. It should not succeed. - status = flr->ReleaseHandle(handle); - if (!status.ok()) return status; - - Status status2 = Run(flr, handle, opts, args, std::move(rets)); - EXPECT_TRUE(errors::IsInvalidArgument(status2)); - EXPECT_TRUE( - str_util::StrContains(status2.error_message(), "remote execution.")); - - return status; + TF_RETURN_IF_ERROR(Run(flr, handle, opts, args, rets, add_runner)); + return flr->ReleaseHandle(handle); } Status Run(FunctionLibraryRuntime* flr, FunctionLibraryRuntime::Handle handle, @@ -304,16 +293,8 @@ class FunctionLibraryRuntimeTest : public ::testing::Test { *rets[i] = retvals[i]; } - // Release the handle and try running again. It should not succeed. - status = flr->ReleaseHandle(handle); - if (!status.ok()) return status; - - Status status2 = Run(flr, handle, opts, args, std::move(rets)); - EXPECT_TRUE(errors::IsInvalidArgument(status2)); - EXPECT_TRUE( - str_util::StrContains(status2.error_message(), "remote execution.")); - - return status; + // Release the handle. + return flr->ReleaseHandle(handle); } std::unique_ptr<Graph> GetFuncBody(FunctionLibraryRuntime* flr, |