LayerAnimationElementTest.ToString fails in single process tests mode |
||
Issue description
$ ./out/Release/compositor_unittests --single-process-tests --gtest_filter=LayerAnimationElementTest.*
...
[ RUN ] LayerAnimationElementTest.ToString
../../ui/compositor/layer_animation_element_unittest.cc:436: Failure
Expected: "LayerAnimationElement{name=ThreadedOpacityTransition, id=1, group=42, " "last_progressed_fraction=0.00, start_frame_number=0}"
Which is: "LayerAnimationElement{name=ThreadedOpacityTransition, id=1, group=42, last_progressed_fraction=0.00, start_frame_number=0}"
To be equal to: element->ToString()
Which is: "LayerAnimationElement{name=ThreadedOpacityTransition, id=12, group=42, last_progressed_fraction=0.00, start_frame_number=0}"
[ FAILED ] LayerAnimationElementTest.ToString (0 ms)
The reason is that the test checks the animation_id_, which is set from a global counter that is incremented each time an animation is created. If the tests are running in the same process, this will increment from earlier tests and be wrong for LayerAnimationElementTest.ToString.
Low priority since I believe tests are usually run in multiple-process mode, but I don't think tests should fail in single process mode either :).
More generally I don't understand why we have tests explicitly checking ToString? Walking the callers of LayerAnimationElement::ToString() in codesearch, it looks like this (and LayerAnimationSequence::ElementsToString()) are only used in tests - shouldn't the tests be explicitly checking variable values rather than doing string comparison?
,
Oct 4 2017
I'm fine with the tests with just the flake fixed if the ToString methods are just for debugging. I'm not even sure you would need tests, but if you want them then that's fine!
,
Oct 4 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/b00e05518d601322ecdbe95f4afe70d386eedfe8 commit b00e05518d601322ecdbe95f4afe70d386eedfe8 Author: Walter Korman <wkorman@chromium.org> Date: Wed Oct 04 20:50:49 2017 De-flake animation id tests. Add Animation::ToString(RunState). Bug: 771620 Cq-Include-Trybots: master.tryserver.blink:linux_trusty_blink_rel Change-Id: I2dc798906f16528b4e56b9f7c6bb7869327afb54 Reviewed-on: https://chromium-review.googlesource.com/700734 Reviewed-by: danakj <danakj@chromium.org> Reviewed-by: Robert Flack <flackr@chromium.org> Reviewed-by: Stephen McGruer <smcgruer@chromium.org> Commit-Queue: Walter Korman <wkorman@chromium.org> Cr-Commit-Position: refs/heads/master@{#506507} [modify] https://crrev.com/b00e05518d601322ecdbe95f4afe70d386eedfe8/cc/animation/animation.cc [modify] https://crrev.com/b00e05518d601322ecdbe95f4afe70d386eedfe8/cc/animation/animation.h [modify] https://crrev.com/b00e05518d601322ecdbe95f4afe70d386eedfe8/cc/animation/animation_unittest.cc [modify] https://crrev.com/b00e05518d601322ecdbe95f4afe70d386eedfe8/ui/compositor/layer_animation_element.cc [modify] https://crrev.com/b00e05518d601322ecdbe95f4afe70d386eedfe8/ui/compositor/layer_animation_element_unittest.cc [modify] https://crrev.com/b00e05518d601322ecdbe95f4afe70d386eedfe8/ui/compositor/layer_animation_sequence_unittest.cc
,
Oct 4 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by wkorman@chromium.org
, Oct 4 2017