MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/cc/training/coordinator_test.cc:39–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39TEST(CoordinatorTest, TestStopAndWaitOnStop) {
40 Coordinator coord;
41 EXPECT_EQ(coord.ShouldStop(), false);
42
43 Notification about_to_wait;
44 Notification done;
45 Env::Default()->SchedClosure(
46 std::bind(&WaitForStopThread, &coord, &about_to_wait, &done));
47 about_to_wait.WaitForNotification();
48 Env::Default()->SleepForMicroseconds(1000 * 1000);
49 EXPECT_FALSE(done.HasBeenNotified());
50
51 TF_EXPECT_OK(coord.RequestStop());
52 done.WaitForNotification();
53 EXPECT_TRUE(coord.ShouldStop());
54}
55
56class MockQueueRunner : public RunnerInterface {
57 public:

Callers

nothing calls this directly

Calls 15

DefaultFunction · 0.85
HasBeenNotifiedMethod · 0.80
RequestStopMethod · 0.80
StartCountingMethod · 0.80
RegisterRunnerMethod · 0.80
WaitForStopMethod · 0.80
StartSettingStatusMethod · 0.80
AllRunnersStoppedMethod · 0.80
StatusClass · 0.50
ShouldStopMethod · 0.45
SchedClosureMethod · 0.45
WaitForNotificationMethod · 0.45

Tested by

no test coverage detected