> On Feb. 19, 2016, 9:02 a.m., Alexander Rukletsov wrote:
> > src/tests/fetcher_cache_tests.cpp, lines 189-191
> > <https://reviews.apache.org/r/43367/diff/12/?file=1254386#file1254386line189>
> >
> > Will it be more clear to explicitly advance clock in those tests? I
> > think keeping changes local, i.e. making them only there where they are
> > necessary, serves educational purposes. People often read tests to
> > understand how things work, hence it's valuable not to distract them with
> > irrelevant actions, nor to hide meaningful steps.
Do you mean move
```
Future<vector<Offer>> offers;
EXPECT_CALL(scheduler, resourceOffers(driver, _))
.WillOnce(FutureArg<1>(&offers))
.WillRepeatedly(DeclineOffers());
// The default timeout in AWAIT_READY is 15 seconds,
// so we use that amount here.
// TODO(bernd-mesos): Make this a symbolic constant in "gtest.hpp"
// that we can reference here.
offers.await(Seconds(15));
if (!offers.isReady()) {
return Error("Failed to wait for resource offers: " +
(offers.isFailed() ? offers.failure() : "discarded"));
}
CHECK_NE(0u, offers.get().size());
const Offer offer = offers.get()[0];
```
out and use advance clock according to different test cases?
Or pass a new param
```
Try<FetcherCacheTest::Task> FetcherCacheTest::launchTask(
const CommandInfo& commandInfo,
const size_t taskIndex,
const bool& advanceAllocation)
```
- haosdent
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/43367/#review119838
-----------------------------------------------------------
On Feb. 18, 2016, 2:54 p.m., haosdent huang wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/43367/
> -----------------------------------------------------------
>
> (Updated Feb. 18, 2016, 2:54 p.m.)
>
>
> Review request for mesos, Alexander Rukletsov, Benjamin Bannier, and Bernd
> Mathiske.
>
>
> Bugs: MESOS-4628
> https://issues.apache.org/jira/browse/MESOS-4628
>
>
> Repository: mesos
>
>
> Description
> -------
>
> Speed up FetcherCache test cases by reduce allocation_interval.
>
>
> Diffs
> -----
>
> src/tests/fetcher_cache_tests.cpp f9c48f5d938c2601cb8f826029d6969d676ab98e
>
> Diff: https://reviews.apache.org/r/43367/diff/
>
>
> Testing
> -------
>
> In this patch, we use 500ms instead of the default allocation_interval 1s. If
> the test cases depends on getting offers from master multiple times, this
> patch could reduce the offer waiting time and speed up them.
>
> Before
> ```
> [ OK ] FetcherCacheTest.LocalUncached (943 ms)
> [ OK ] FetcherCacheTest.LocalCached (1612 ms)
> [ OK ] FetcherCacheTest.CachedFallback (906 ms)
> [ OK ] FetcherCacheTest.LocalUncachedExtract (940 ms)
> [ OK ] FetcherCacheTest.LocalCachedExtract (1719 ms)
> [ OK ] FetcherCacheTest.SimpleEviction (3635 ms)
> [ OK ] FetcherCacheTest.FallbackFromEviction (2518 ms)
> [ OK ] FetcherCacheTest.RemoveLRUCacheEntries (3653 ms)
> [ OK ] FetcherCacheHttpTest.HttpCachedSerialized (2632 ms)
> [ OK ] FetcherCacheHttpTest.HttpCachedConcurrent (1227 ms)
> [ OK ] FetcherCacheHttpTest.HttpMixed (1129 ms)
>
> ```
>
> After
> ```
> [ OK ] FetcherCacheTest.LocalUncached (979 ms)
> [ OK ] FetcherCacheTest.LocalCached (1510 ms)
> [ OK ] FetcherCacheTest.CachedFallback (853 ms)
> [ OK ] FetcherCacheTest.LocalUncachedExtract (816 ms)
> [ OK ] FetcherCacheTest.LocalCachedExtract (1715 ms)
> [ OK ] FetcherCacheTest.SimpleEviction (2720 ms)
> [ OK ] FetcherCacheTest.FallbackFromEviction (2119 ms)
> [ OK ] FetcherCacheTest.RemoveLRUCacheEntries (2847 ms)
> [ OK ] FetcherCacheHttpTest.HttpCachedSerialized (2233 ms)
> [ OK ] FetcherCacheHttpTest.HttpCachedConcurrent (1211 ms)
> [ OK ] FetcherCacheHttpTest.HttpMixed (1106 ms)
> ```
>
>
> Thanks,
>
> haosdent huang
>
>