[
https://issues.apache.org/jira/browse/MESOS-8890?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Chun-Hung Hsiao reassigned MESOS-8890:
--------------------------------------
Assignee: (was: Chun-Hung Hsiao)
> Improve debuggability of `MockResourceProvider::send()`.
> --------------------------------------------------------
>
> Key: MESOS-8890
> URL: https://issues.apache.org/jira/browse/MESOS-8890
> Project: Mesos
> Issue Type: Improvement
> Reporter: Chun-Hung Hsiao
> Priority: Major
> Labels: mesosphere, storage
>
> {{MockResourceProvider::send}} uses {{Driver::send}} to send HTTP requests
> for v1 API calls, which returns a failure if the request is failed. However,
> we haven't established a programming pattern to reflect the failures properly
> in tests, and it makes debugging new tests hard.
> To improve the debuggability of the mock resource provider, we could keep
> track of all futures returned by {{Driver::send}}, and await for them to
> become ready before tearing down the mock resource provider.
> NOTE: At a first look, we could improve the debuggability by registering the
> following callback:
> {code:java}
> process::Future<Nothing> send(const Call& call)
> {
> return driver->send(call)
> .onAny([](const process::Future<Nothing>& future) {
> ASSERT_TRUE(future.isReady()) << future;
> });
> }
> {code}
> However, this could potentially introduce some test flakiness, as if the test
> is torn down before the driver process the HTTP response, the above future
> will fail due to disconnection when the the 202 Accept HTTP response is in
> transmission (so this cannot be fixed by simply adding a {{Clock::settle}}
> call:
> {noformat}
> Value of: future.isReady()
> Actual: false
> Expected: true
> Failed: Disconnected
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)