> On Jan. 3, 2015, 7:57 a.m., Timothy Chen wrote:
> > are you planning to write a test or uodate anexisting one?
>
> Connor Doyle wrote:
> Yes definitely, tests are forthcoming. Will add to or modify
> `src/tests/reconciliation_tests.cpp`.
>
> Stefan Schimanski wrote:
> A very simple test:
>
> ```diff
> --- a/src/tests/health_check_tests.cpp
> +++ b/src/tests/health_check_tests.cpp
> @@ -139,7 +139,8 @@ public:
> };
>
>
> -// Testing a healthy task reporting one healthy status to scheduler.
> +// Testing a healthy task reporting one healthy status to scheduler and
> +// on reconciliation.
> TEST_F(HealthCheckTest, HealthyTask)
> {
> Try<PID<Master> > master = StartMaster();
> @@ -193,6 +194,25 @@ TEST_F(HealthCheckTest, HealthyTask)
> EXPECT_EQ(TASK_RUNNING, statusHealth.get().state());
> EXPECT_TRUE(statusHealth.get().healthy());
>
> + Future<TaskStatus> statusReconciliation;
> + EXPECT_CALL(sched, statusUpdate(&driver, _))
> + .WillOnce(FutureArg<1>(&statusReconciliation));
> +
> + vector<TaskStatus> statuses;
> + TaskStatus status;
> + const TaskID taskId = statusHealth.get().task_id();
> + const SlaveID slaveId = statusHealth.get().slave_id();
> + status.mutable_task_id()->CopyFrom(taskId);
> + status.mutable_slave_id()->CopyFrom(slaveId);
> + status.set_state(TASK_KILLED);
> + statuses.push_back(status);
> + driver.reconcileTasks(statuses);
> +
> + AWAIT_READY(statusReconciliation);
> + EXPECT_EQ(TASK_RUNNING, statusReconciliation.get().state());
> + EXPECT_TRUE(statusReconciliation.get().has_healthy());
> + EXPECT_TRUE(statusReconciliation.get().healthy());
> +
> driver.stop();
> driver.join();
> ```
Thanks, embellished this to test both implicit & explicit reconciliation and
added to the patch.
- Connor
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/29556/#review66576
-----------------------------------------------------------
On Jan. 6, 2015, 5:29 a.m., Connor Doyle wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/29556/
> -----------------------------------------------------------
>
> (Updated Jan. 6, 2015, 5:29 a.m.)
>
>
> Review request for mesos, Adam B and Timothy Chen.
>
>
> Bugs: MESOS-2206
> https://issues.apache.org/jira/browse/MESOS-2206
>
>
> Repository: mesos-git
>
>
> Description
> -------
>
> Task statuses sent to the framework scheduler from the master do not include
> a value for the `healthy` field. The result is that the scheduler is left
> with incomplete knowledge about the health state of running tasks
> indefinitely, until by chance the executor sends a new status update.
>
> - Update the createTaskStatus auxilliary function in protobuf utils to take
> an optional health flag.
> - Pass known health to createTaskStatus during implicit and explicit task
> reconciliation.
>
>
> Diffs
> -----
>
> src/common/protobuf_utils.hpp e42aaa5
> src/common/protobuf_utils.cpp 8ab5cdd
> src/master/master.cpp d6651e2
> src/tests/health_check_tests.cpp a707398
>
> Diff: https://reviews.apache.org/r/29556/diff/
>
>
> Testing
> -------
>
> - make
> - make check
>
> Manual testing using a development branch of the Marathon[1] framework:
>
> - Launched two tasks with health checks.
> - Waited for both tasks to enter the running state.
> - Waited for both tasks to report healthy.
> - Shut down the scheduler.
> - Re-started (re-registered) the scheduler.
> - Observed indeterminate health state for both tasks as reported by the
> framework.
> - Waited for the framework to initiate task reconciliation.
> - Observed a TaskStatus with the healthy field set to `true` for both tasks.
>
> [1] http://github.com/mesosphere/marathon
>
>
> Thanks,
>
> Connor Doyle
>
>