--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/7c8172c6-9c39-4234-a65e-0418e4160ab1%40chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CACuR13ecqD0zEDaN%2B9b2MPBmM7c_iw-absN69F1-bGTc0ssaTQ%40mail.gmail.com.
Thanks, Sergio, for putting together a nicely-written problem statement for the wider audience.w.r.t. changing the mock clock between tests: Are the individual tests running in the same process? I thought gtest forked a separate process for each one?
On Thu, Feb 28, 2019 at 4:46 PM Yuri Wiitala <m...@chromium.org> wrote:Thanks, Sergio, for putting together a nicely-written problem statement for the wider audience.w.r.t. changing the mock clock between tests: Are the individual tests running in the same process? I thought gtest forked a separate process for each one?No, it doesn't. It divides the test cases among some number of processes between 1 and the number of tests. It is possible for state from one unit test to affect another if it is not cleaned up properly (this mostly affects globals). When that happens, the test will often pass on retry.This would mean that the mocked time values between tests won't end up mixing in the task runner.A couple of random ideas:1a. Instead of scoped mocking, only allow one override that must remain in-place permanently for the life of the process. Then...1b. Force the mock clock to always start at the prior clock's Now() point.
2. Add some infrastructure to notify the task scheduler that the clock is being changed. (Or, maybe just have some way to cancel all tasks from all task queues, and ScopedMockClockOverrides could call that.) The threading around this might be very tricky, though.
So assuming that we create a scoped class to handle mock clock inside
the tests, how would tests have access to that clock in order to
advance it?. Would it be a global exposed to tests? What should be the
best location for it?
BR
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/a5b8d37c045d5f4486c72d67b5f78ea39ce92498.camel%40igalia.com.
BR
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/2187ca68fd3e01801490bd06b8cb0e061b896c74.camel%40igalia.com.
--BR
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/2187ca68fd3e01801490bd06b8cb0e061b896c74.camel%40igalia.com.
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CACuR13e4OLsw3_xXTOP7fc1aXXR6BNMb1oAzj8BQmQ%2B%2BS3wRXw%40mail.gmail.com.
BR
> It would be great if we could reliably shut down everything but the
> main thread in tests. I'm of the opinion it would be good to built
> the blink equivalent of TestBrowserThreadBundle which would provide a
> uniform way of writing tests with mock time and solve all these TSAN
> issues.
>
>
>
> >
> > > BR
> > >
> > > --
> > > You received this message because you are subscribed to the
> > > Google Groups "platform-architecture-dev" group.
> > > To unsubscribe from this group and stop receiving emails from it,
> > > send an email to
> > > platform-architect...@chromium.org.
> > > To post to this group, send email to
> > > platform-arc...@chromium.org.
> > > To view this discussion on the web visit
> > > https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/2187ca68fd3e01801490bd06b8cb0e061b896c74.camel%40igalia.com
> > > .
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/1df428642b0e76e6798dc32f7e5dc38dc5a0d978.camel%40igalia.com.
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/d2109cbd5110183a39d6228d200b7c93da865e07.camel%40igalia.com.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architecture-dev+unsub...@chromium.org.
To post to this group, send email to platform-architecture-dev@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/d2109cbd5110183a39d6228d200b7c93da865e07.camel%40igalia.com.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/d2109cbd5110183a39d6228d200b7c93da865e07.camel%40igalia.com.
--Kentaro Hara, Tokyo, Japan
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/c436ad9d-b2ec-4781-bfd5-eb13c1528468%40chromium.org.
> I think that long-term this will be far less invasive than plumbing
> SetTickClockForTesting() and SetTaskRunnerForTesting() everywhere.
While I agree that is less invasive I think we should also put things
in context. Completely removing the dependency of Blink's wtf/time.h
would mean migrating <20 tests out of 13k. Knowing that
CurrentTimeTicks() & family are basically everywhere in Blink's
codebase I think it's a pretty good deal, not ideal, but fair enough.
> Lastly, re. TestMockTimeTaskRunner : on the browser-side it is close
> to deprecated as ScopedTaskEnvironment is a strictly superior
> construct. The only valid use case remaining is having multiple
> TestMockTimeTaskRunner to simulate lock step threading from the main
> test thread but this is rare. I think we should aim to be consistent
> with this direction in Blink.
I think this is a quite important comment. When I started working on
this, I noticed that there are many different ways to mock time in
Chromium right now. Deciding which one was the most suitable took a lot
of time because all of them have cons and pros. You were on top of
ScopedTaskEnvironment so you're aware of the differences with previous
approaches but for people writing new tests is far from evident. IMO we
should focus as well on not duplicating the way of mocking time. And
IMO the approach I followed goes in the right direction, even though
the long-term solution is likely the one you pointed out.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CAJTZ7L%2BvPRm-Dq1mX%3DenVx-b1nZeZ1bmceAtuLPLepoft82mug%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "platform-architecture-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/522cee796d534522365bd8304e9689574e07b3c1.camel%40igalia.com.
You received this message because you are subscribed to a topic in the Google Groups "platform-architecture-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/a/chromium.org/d/topic/platform-architecture-dev/0x9xaxlBvB4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to platform-architect...@chromium.org.
To post to this group, send email to platform-arc...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/platform-architecture-dev/CALHg4nk%2B4xgoKGRSRU-MoJNhk9EMEApJM%3DEejQ6J%2BrFk2S2S-w%40mail.gmail.com.