{"record":{"id":"e84114546bb9e3c0","repo":"facebook/relay","slug":"zebra-not-found","errorCode":null,"errorMessage":"zebra not found","messagePattern":"zebra not found","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/crates/schema-set/src/build_schema_document.rs","lineNumber":964,"sourceCode":"            interface_pos < extension_pos,\n            \"Definitions should print before extensions: {}\",\n            sdl,\n        );\n    }\n\n    #[test]\n    fn test_object_fields_sorted_alphabetically() {\n        let sdl = schema_sdl(indoc! {r#\"\n            type Foo {\n              zebra: String\n              apple: Int\n              mango: Boolean\n            }\n        \"#});\n        // Fields should be sorted alphabetically\n        let apple_pos = sdl.find(\"apple\").expect(\"apple not found\");\n        let mango_pos = sdl.find(\"mango\").expect(\"mango not found\");\n        let zebra_pos = sdl.find(\"zebra\").expect(\"zebra not found\");\n        assert!(\n            apple_pos < mango_pos && mango_pos < zebra_pos,\n            \"Fields should be sorted: {}\",\n            sdl,\n        );\n    }\n\n    // --- Interface ---\n\n    #[test]\n    fn test_interface_with_fields() {\n        let sdl = schema_sdl(indoc! {r#\"\n            interface Node {\n              id: ID!\n            }\n        \"#});\n        assert!(sdl.contains(\"interface Node\"), \"Got: {}\", sdl);\n        assert!(sdl.contains(\"id: ID!\"), \"Got: {}\", sdl);","sourceCodeStart":946,"sourceCodeEnd":982,"githubUrl":"https://github.com/facebook/relay/blob/668b1b85e06261aa3b58dabfc51f8b5524a70955/compiler/crates/schema-set/src/build_schema_document.rs#L946-L982","documentation":"This is a test assertion panic inside build_schema_document.rs, not a runtime library error. A test generates SDL for a schema document and calls `sdl.find(\"zebra\")`, expecting a field (or type at line 1190) named 'zebra' to appear in the rendered SDL. The expect() failed, meaning the rendered output never contained the literal 'zebra', so the field/type was not emitted or not emitted with that exact spelling.","triggerScenarios":"Running the schema-set tests when `build_schema_document` (or `test_printed_fields_sorted`'s fixture schema) fails to include the 'zebra' field in the printed SDL — e.g. the builder dropped the field, renamed/cased it, filtered it, or field/type sorting output changed so the printed name differs from the searched literal.","commonSituations":"Developers hit this after modifying the schema document builder (changing print order, filtering fields, changing naming conventions), after updating fixture schemas, or when refactoring the test schema inputs so the 'zebra' test entity no longer exists in the built document.","solutions":["Print the `sdl` string (the panic already shows it via the assert message context, but the expect fails before) — add a debug print of `sdl` before the find calls and inspect why 'zebra' is absent.","Verify the test fixture still defines the zebra field/type and that the builder includes it in the output document.","Check for exact-match issues: the SDL may print the field with different casing or as `zebra:` vs `zebra(` — loosen the assertion or fix the printer to match the expected SDL format.","If field/type sorting was intentionally changed, update the test's expectations to match the new sorted output.","Run `cargo test -p schema-set` with `--nocapture` to see full SDL output and diff against the expected snapshot."],"exampleFix":"// before\nlet zebra_pos = sdl.find(\"zebra\").expect(\"zebra not found\");\n// after\nlet zebra_pos = sdl\n    .find(\"zebra\")\n    .unwrap_or_else(|| panic!(\"zebra not found in SDL:\\n{}\", sdl));","handlingStrategy":"validation","validationCode":"let zebra_pos = sdl.find(\"zebra\").unwrap_or_else(|| panic!(\"zebra not found in SDL:\\n{}\", sdl));","typeGuard":"fn position_of(sdl: &str, needle: &str) -> Option<usize> {\n    sdl.find(needle)\n}","tryCatchPattern":null,"preventionTips":["Use unwrap_or_else with a panic message that prints the full SDL for debuggability.","Add snapshot tests of the rendered SDL so changes to printing are caught explicitly.","Keep fixture schemas and expected field names in sync when modifying the builder.","Run the schema-set test suite after any change to document printing or sorting logic."],"tags":["rust","test-assertion","sdl","codegen"],"backgroundTag":"test-assertion-panic","analyzedSha":"668b1b85e06261aa3b58dabfc51f8b5524a70955","analyzedAt":"2026-09-02T19:57:20.783Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}