Skip to content

Test that PlanningReport can be serialized as JSON #9081

@jgallagher

Description

@jgallagher

While testing update on dublin, a Nexus instance went into maintenance after panicking multiple times with

thread 'tokio-runtime-worker' panicked at nexus/src/app/background/tasks/blueprint_planner.rs:295:31:
called `Result::unwrap()` on an `Err` value: Error("key must be a string", line: 0, column: 0)

and included this error log shortly before the panic:

{"msg":"could not serialize blueprint planning report","v":0,"name":"nexus","level":50,"time":"2025-09-24T18:19:01.819740006Z","hostname":"oxz_nexus_a4c68a8c-7e9a-45a4-8adc-88de59616d9d","pid":11682,"component":"datastore","component":"nexus","component":"ServerContext","name":"a4c68a8c-7e9a-45a4-8adc-88de59616d9d","file":"nexus/db-queries/src/db/datastore/deployment.rs:531","error":"key must be a string"}

#9080 fixes two maps that had non-string keys and removes the call to json!() that induced this panic, but does not add any test coverage for other maps I might've missed or that might be added in the future. @sunshowers suggested we add a proptest that generates arbitrary reports and confirms we can serialize them to JSON.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions