Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ‘©β€πŸŒΎ Fix flaky SceneBroadcaster test #641

Merged
merged 4 commits into from
Feb 23, 2021

Conversation

chapulina
Copy link
Contributor

@chapulina chapulina commented Feb 19, 2021

Signed-off-by: Louise Poubel [email protected]

🦟 Bug fix

Summary

The State test has been flaky, with this error:

113: /var/lib/jenkins/workspace/ignition_gazebo-ci-ign-gazebo3-bionic-amd64/ign-gazebo/test/integration/scene_broadcaster_system.cc:385: Failure
113: Expected equality of these values:
113:   _count
113:     Which is: 3
113:   _msg.state().entities_size()
113:     Which is: 16

I can also reproduce the flakiness locally.

What happens is that the subscriber correctly receives 3 entities, but then it remains subscribed. As the test goes on to make another full state request, which sends 16 entities, if the test lasts long enough, the subscriber often receives that too and the test fails. The solution is to unsubscribe from that topic as soon as we're done checking for the 3 entities.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge


https://github.com/osrf/buildfarmer/issues/156

Signed-off-by: Louise Poubel <[email protected]>
@chapulina chapulina added the tests Broken or missing tests / testing infra label Feb 19, 2021
@github-actions github-actions bot added the 🏰 citadel Ignition Citadel label Feb 19, 2021
@codecov
Copy link

codecov bot commented Feb 20, 2021

Codecov Report

Merging #641 (adeadae) into ign-gazebo3 (60d9eb8) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##           ign-gazebo3     #641   +/-   ##
============================================
  Coverage        77.74%   77.74%           
============================================
  Files              210      210           
  Lines            11628    11628           
============================================
  Hits              9040     9040           
  Misses            2588     2588           

Continue to review full report at Codecov.

Legend - Click here to learn more
Ξ” = absolute <relative> (impact), ΓΈ = not affected, ? = missing data
Powered by Codecov. Last update 60d9eb8...adeadae. Read the comment docs.

@chapulina
Copy link
Contributor Author

The test failed differently on homebrew with an exception:

ServerRepeat/SceneBroadcasterTest.State
113: [ RUN      ] ServerRepeat/SceneBroadcasterTest.State/0
113: [Wrn] [Component.hh:144] Trying to serialize component with data type [Trying to serialize component with data type [[Wrn] [Component.hh:144] N3sdf2v95ModelEN3sdf2v95ModelE[Wrn] [Component.hh:144] ], which doesn't have Trying to serialize component with data type [Trying to serialize component with data type [N3sdf2v95ModelE`operator<<`. Component will not be serialized.N3sdf2v95WorldE
113: ], which doesn't have [Msg] Loading SDF world file[/Users/jenkins/workspace/ignition_gazebo-ci-pr_any-homebrew-amd64/ign-gazebo/test/worlds/shapes.sdf].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [2251689575469537287] / [ign_gazebo_components.World].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [13994732549916512682] / [ign_gazebo_components.Name].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [12592746352568925681] / [ign_gazebo_components.Gravity].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [13224937992534617849] / [ign_gazebo_components.MagneticField].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [3630648173860223239] / [ign_gazebo_components.PhysicsEnginePlugin].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [17459188283658606303] / [ign_gazebo_components.RenderEngineServerPlugin].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [8705992680619689917] / [ign_gazebo_components.RenderEngineGuiPlugin].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [8753193699724811771] / [ign_gazebo_components.Wind].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [12173050716021724529] / [ign_gazebo_components.WorldLinearVelocity].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [15943768124495574352] / [ign_gazebo_components.WorldLinearVelocitySeed].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [3297509811873971798] / [ign_gazebo_components.ParentEntity].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [17100615127981600159] / [ign_gazebo_components.Scene].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [17605309075052480649] / [ign_gazebo_components.Atmosphere].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [8064491505919932473] / [ign_gazebo_components.Level].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [2668898242563798256] / [ign_gazebo_components.DefaultLevel].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [11371360182141354106] / [ign_gazebo_components.LevelEntityNames].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [4981278897826323946] / [ign_gazebo_components.WorldSdf].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [6687176221774458630] / [ign_gazebo_components.Model].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [6612894081701502240] / [ign_gazebo_components.Pose].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [8546580419506082455] / [ign_gazebo_components.Static].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [9712747055438129860] / [ign_gazebo_components.WindMode].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [5661073481138181711] / [ign_gazebo_components.SelfCollide].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [11683062252779233161] / [ign_gazebo_components.SourceFilePath].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [5081358965268446661] / [ign_gazebo_components.Link].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [8112400427272910195] / [ign_gazebo_components.Inertial].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [16454635107327670381] / [ign_gazebo_components.Visual].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [13011964647677164955] / [ign_gazebo_components.CastShadows].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [13440282432131634483] / [ign_gazebo_components.Transparency].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [5522706856600206064] / [ign_gazebo_components.LaserRetro].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [17121648710877364109] / [ign_gazebo_components.Geometry].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [9853217982010720764] / [ign_gazebo_components.Material].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [17938588655714334139] / [ign_gazebo_components.Collision].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [9225962031573086509] / [ign_gazebo_components.CollisionElement].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [10522242218202596205] / [ign_gazebo_components.CanonicalLink].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [11536476718181283925] / [ign_gazebo_components.ModelSdf].
113: [Dbg] [EntityComponentManager.cc:632] Using components of type [3866641186784191835] / [ign_gazebo_components.Light].
113: [Msg] Loaded level [3]
113: [Msg] No systems loaded from SDF, loading defaults
113: [Dbg] [ServerConfig.cc:915] Loaded (3) plugins from file [/Users/jenkins/.ignition/gazebo/server.config]
113: [Dbg] [Physics.cc:600] Loaded [ignition::physics::dartsim::Plugin] from library [/usr/local/Cellar/ignition-physics2/2.3.0_2/lib/ign-physics-2/engine-plugins/libignition-physics-dartsim-plugin.dylib]
113: [Dbg] [SimulationRunner.cc:775] Loaded system [ignition::gazebo::systems::Physics] for entity [1]
113: [Msg] Create service on [/world/default/create]
113: [Msg] Remove service on [/world/default/remove]
113: [Msg] Pose service on [/world/default/set_pose]
113: [Dbg] [SimulationRunner.cc:775] Loaded system [ignition::gazebo::systems::UserCommands] for entity [1]
113: [Dbg] [SimulationRunner.cc:775] Loaded system [ignition::gazebo::systems::SceneBroadcaster] for entity [1]
113: [Msg] Serving world controls on [/world/default/control] and [/world/default/playback/control]
113: [Msg] Serving GUI information on [/world/default/gui/info]
113: [Msg] World [default] initialized with [1ms] physics profile.
113: [Msg] Serving world SDF generation service on [/world/default/generate_world_sdf]
113: [Msg] Serving world names on [/gazebo/worlds]
113: [Msg] Resource path add service on [/gazebo/resource_paths/add].
113: [Msg] Resource path get service on [/gazebo/resource_paths/get].
113: [Msg] Resource paths published on [/gazebo/resource_paths].
113: [Msg] Found no publishers on /stats, adding root stats topic
113: [Msg] Found no publishers on /clock, adding root clock topic
113: [Dbg] [SimulationRunner.cc:422] Creating PostUpdate worker threads: 2
113: [Dbg] [SimulationRunner.cc:435] Creating postupdate worker thread (0)
113: [Msg] Serving scene information on [/world/default/scene/info]
113: [Msg] Serving graph information on [/world/default/scene/graph]
113: [Msg] Serving full state on [/world/default/state]
113: [Msg] Serving full state (async) on [/world/default/state_async]
113: [Msg] Publishing scene information on [/world/default/scene/info]
113: [Msg] Publishing entity deletions on [/world/default/scene/deletion]
113: [Msg] Publishing state changes on [/world/default/state]
113: [Msg] Publishing pose messages on [/world/default/pose/info]
113: [Msg] Publishing dynamic pose messages on [/world/default/dynamic_pose/info]
113: [Dbg] [EntityComponentManager.cc:954] Updated state thread iterators: 12 threads processing around 2 components each.
113: `operator<<`. Component will not be serialized.
113/140 Test #113: INTEGRATION_scene_broadcaster_system .................Subprocess aborted***Exception:   1.66 sec

I'll take a look, please don't merge yet

@chapulina chapulina changed the title πŸ‘©β€πŸŒΎ Fix flaky SceneBoradcaster test πŸ‘©β€πŸŒΎ Fix flaky SceneBroadcaster test Feb 22, 2021
@chapulina
Copy link
Contributor Author

The test failed differently on homebrew with an exception:

I didn't change anything and it passed now. It may be flaky. Merging this since it improves the situation.

@chapulina chapulina merged commit 4a4951e into ign-gazebo3 Feb 23, 2021
@chapulina chapulina deleted the chapulina/3/flaky_state branch February 23, 2021 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel tests Broken or missing tests / testing infra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants