Repository: mesos Updated Branches: refs/heads/vinod/scheduler_tests_heartbeat_fix [created] f011b0a98
Fixed scheduler tests to work with heartbeats. Review: https://reviews.apache.org/r/37449 Project: http://git-wip-us.apache.org/repos/asf/mesos/repo Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/f011b0a9 Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/f011b0a9 Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/f011b0a9 Branch: refs/heads/vinod/scheduler_tests_heartbeat_fix Commit: f011b0a98e5a1c28f6c670102374f5317488fa03 Parents: b62c6e6 Author: Vinod Kone <[email protected]> Authored: Thu Aug 13 16:17:52 2015 -0700 Committer: Vinod Kone <[email protected]> Committed: Thu Aug 13 16:52:09 2015 -0700 ---------------------------------------------------------------------- src/tests/scheduler_tests.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/mesos/blob/f011b0a9/src/tests/scheduler_tests.cpp ---------------------------------------------------------------------- diff --git a/src/tests/scheduler_tests.cpp b/src/tests/scheduler_tests.cpp index 837d9e8..7842f27 100644 --- a/src/tests/scheduler_tests.cpp +++ b/src/tests/scheduler_tests.cpp @@ -97,7 +97,14 @@ ACTION_P(Enqueue, queue) { std::queue<Event> events = arg0; while (!events.empty()) { - queue->put(events.front()); + // Note that we currently drop HEARTBEATs because most of these tests + // are not designed to deal with heartbeats. + // TODO(vinod): Implement DROP_HTTP_CALLS that can filter heartbeats. + if (events.front().type() == Event::HEARTBEAT) { + VLOG(1) << "Ignoring HEARTBEAT event"; + } else { + queue->put(events.front()); + } events.pop(); } }
