Skip to content

[Proposal] A new, more unified way to identify when iTowns view is loaded and stable for testing #2530

@airnez

Description

@airnez

Context

During march 2025 iTowns hackaton, we identified that using the view schedueler to subdivide TiledGeometryLayer's nodes was odd. It is an almost instantaneous process, and schedueling it along network request is confusing. The PR #2521 and #2525 do attempt to adress issue #2421.

However, it does break our functionnal tests for a good reason: It becomes harder to know if current iTowns view is stabilized.

  • If the test launches prematurely, some layers might be missing (the scheduler becomes empty inbetween two layers addition). For the source_stream_wfs_raster test, that's what happens. VIEW_EVENTS.LAYERS_INITIALIZED event is triggered too early.

Image

  • If a test prematurely considers that the view is stabilized, it might measure values at the wrong moment. This is the case for view_multiglobe test

Image

  • It a sub-test ends prematurely, it might influence upcoming tests. This is the case for the two failing globecontrol tests.

Image

It is possible to handle all those specific tests. By first querying the datasources prior to view instancing, it should be possible to avoid in-between layers VIEW_EVENTS.LAYERS_INITIALIZED trigger. Listening to animations or frameRequesters helps identifying view stabilization.

It however feels like we are missing a more global approach. Something easy to tell wether or not current view is stabilized or not.

Description of the proposal

Several implementation ideas (not exclusive) :

  • A specific layer property exposing wether or not a layer is currently "working"
  • A new event VIEW_EVENTS.STABILIZED that properly tells when everything is set (how?)
  • A new way to add layers to the view specifying beforehand what will be part of the view. (Passing layer loading promises for instance)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions