Fix queue runner test flakiness. The cost graph may be requested before cost_graph_ is stored.

Change: 154224628
This commit is contained in:
Yuefeng Zhou 2017-04-25 13:49:14 -08:00 committed by TensorFlower Gardener
parent 9509cda97d
commit c19dd491e5

View File

@ -379,6 +379,9 @@ TEST(QueueRunnerTest, RunMetaDataTest) {
// race condition where we close the queue before it was populated.
std::vector<Tensor> dq0;
TF_EXPECT_OK(session->Run({}, {kDequeueOp0}, {}, &dq0));
// Second call to run dequeue op is to make sure the cost graph has been
// stored.
TF_EXPECT_OK(session->Run({}, {kDequeueOp0}, {}, &dq0));
CostGraphDef cost_graph;
TF_CHECK_OK(qr->ExportCostGraph(&cost_graph));