Skip to content

test: catalog changes made through one service reach the other services - #234

Merged
groldan merged 2 commits into
camptocamp:masterfrom
groldan:feature/catalog_change_propagation_tests
Nov 13, 2026
Merged

groldan merged 2 commits into
camptocamp:masterfrom
groldan:feature/catalog_change_propagation_tests

Conversation

@groldan

@groldan groldan commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

GeoServer Cloud runs the REST API, WMS and GWC as separate services, each with its own memory of the catalog, the configuration and the resource store. These tests write through REST and poll WMS and WMTS for the new state: a feature type disabled or created, a style edited, a layer group nested or flattened, a workspace renamed next to a workspace with a similar name, tile layer formats changed through the GWC REST API, and two layers of the same name in different workspaces.

Colors are checked on the top-left pixel of a GetMap over a point drawn with a square large enough to cover the image; the PNG filters leave that pixel as it is, so no image library is needed.

The workspace WMTS capabilities test is expected to fail on GeoServer Cloud, which lists the tile layers of all workspaces there.

on-behalf-of: @camptocamp info@camptocamp.com

GeoServer Cloud runs the REST API, WMS and GWC as separate services, each
with its own memory of the catalog, the configuration and the resource
store. These tests write through REST and poll WMS and WMTS for the new
state: a feature type disabled or created, a style edited, a layer group
nested or flattened, a workspace renamed next to a workspace with a
similar name, tile layer formats changed through the GWC REST API, and
two layers of the same name in different workspaces.

Colors are checked on the top-left pixel of a GetMap over a point drawn
with a square large enough to cover the image; the PNG filters leave that
pixel as it is, so no image library is needed.

The workspace WMTS capabilities test is expected to fail on GeoServer
Cloud, which lists the tile layers of all workspaces there.

on-behalf-of: @camptocamp <info@camptocamp.com>
@groldan

groldan commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

test_change_propagation.py::test_tile_layer_formats_follow_gwc_rest FAILED on vanilla 3.0.1 and 3.0.2 due to a bug:

ERROR [gwc.layer] - Error issuing change events for tile layer GeoServerTileLayerInfoImpl[... metaWidthHeight={0,0}, mimeFormats=[image/jpeg] ...]
java.lang.ArithmeticException: / by zero
    at org.geowebcache.grid.GridSubset.expandToMetaFactors(GridSubset.java:143)
    at org.geowebcache.seed.TileBreeder.createTileRange(TileBreeder.java:361)
    at org.geoserver.gwc.GWC.truncate(GWC.java:625)
    at org.geoserver.gwc.layer.CatalogConfiguration.issueTileLayerInfoChangeNotifications(CatalogConfiguration.java:652)
    at org.geoserver.gwc.layer.CatalogConfiguration.modifyLayer(CatalogConfiguration.java:477)
    at org.geowebcache.rest.controller.TileLayerController.layerPut(TileLayerController.java:116)

The GWC REST PUT is a full replacement, not a merge. The test body has no metaWidthHeight, and upstream's readResolve turns the missing field into {0,0}. Vanilla's CatalogConfiguration.modifyLayer stores that as is. Three things follow:

  • The truncate of the removed PNG format divides by zero. It is caught and logged, and the PUT still answers 200.
  • PNG requests fail because the format is gone from the layer. That is why the "PNG tiles still served" assertion passed.
  • JPEG requests fail too: GeoServerTileLayer.getTile builds a metatile with factors 0x0 and MetaTile.calculateMetaTileGridBounds does tileIdx % metaX. That is the assertion that timed out after 30 s.

GeoServer Cloud passes because PgconfigTileLayerCatalog.toInfo runs completeWithDefaults on save, which fills metatiling, gutter, grid subsets and the other unset values from the GWC defaults. Vanilla has no such step, and GWC accepts a configuration that breaks the layer. Upstream should either reject metaWidthHeight of zero on PUT or default it; worth an issue against GeoServer's gwc module with the trace above.

@groldan
groldan merged commit d5a4250 into camptocamp:master Nov 13, 2026
1 of 2 checks passed
@groldan
groldan deleted the feature/catalog_change_propagation_tests branch November 13, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant