{"record":{"id":"9c6d428bec0dea61","repo":"Hmbown/CodeWhale","slug":"expected-ok-got-other","errorCode":null,"errorMessage":"Expected Ok, got {other:?}","messagePattern":"Expected Ok, got (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":19377,"sourceCode":"            allow_private_network: false,\n        }\n    }\n\n    #[test]\n    fn test_no_command_or_url_is_error() {\n        let server = make_server(None, &[], None);\n        assert!(matches!(\n            doctor_check_mcp_server(&server),\n            McpServerDoctorStatus::Error(_)\n        ));\n    }\n\n    #[test]\n    fn test_url_server_is_ok() {\n        let server = make_server(None, &[], Some(\"http://localhost:3000/mcp\"));\n        match doctor_check_mcp_server(&server) {\n            McpServerDoctorStatus::Ok(detail) => assert!(detail.contains(\"HTTP/SSE\")),\n            other => panic!(\"Expected Ok, got {other:?}\"),\n        }\n    }\n\n    #[test]\n    fn test_command_server_is_ok() {\n        let executable = std::env::current_exe().expect(\"current test executable\");\n        let executable = executable.to_string_lossy();\n        let server = make_server(Some(&executable), &[\"server.js\"], None);\n        match doctor_check_mcp_server(&server) {\n            McpServerDoctorStatus::Ok(detail) => assert!(detail.contains(\"stdio\")),\n            other => panic!(\"Expected Ok, got {other:?}\"),\n        }\n    }\n\n    #[test]\n    fn test_relative_stdio_path_arg_without_cwd_warns() {\n        let executable = std::env::current_exe().expect(\"current test executable\");\n        let executable = executable.to_string_lossy();","sourceCodeStart":19359,"sourceCodeEnd":19395,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/433685b2024e7bc4c99e1e2e326bcad39b4d9d65/crates/tui/src/lib.rs#L19359-L19395","documentation":"A test assertion panic in the MCP server doctor tests: the test builds an HTTP/SSE MCP server definition (url = http://localhost:3000/mcp) and expects doctor_check_mcp_server to report McpServerDoctorStatus::Ok with a detail mentioning 'HTTP/SSE'. Any other status variant (Warning/Error) triggers panic!(\"Expected Ok, got {other:?}\").","triggerScenarios":"doctor_check_mcp_server(&server) returns Warning or Error for a well-formed URL server — e.g. the doctor now probes the URL, fails a health check, or misclassifies a URL-only server as missing a command.","commonSituations":"Doctor logic changed to actually connect and localhost:3000 has no listener in CI; a new validation warns on URL servers; the Ok detail text no longer contains 'HTTP/SSE'; offline CI environments.","solutions":["Print the full other:? status in the panic to see the doctor's reason.","Check doctor_check_mcp_server for new network probing and ensure URL servers are validated structurally, not by connecting.","Confirm the Ok detail string still includes 'HTTP/SSE' or update the assertion to the new wording.","Run the test in isolation to rule out port conflicts with other tests."],"exampleFix":"// before\nother => panic!(\"Expected Ok, got {other:?}\"),\n// after\nother => panic!(\"Expected Ok for url server, got {other:?}\"),","handlingStrategy":"validation","validationCode":"if !server.url.map_or(false, |u| u.starts_with(\"http\")) {\n    eprintln!(\"not a url server; doctor may not return Ok\");\n}","typeGuard":"fn is_url_server(s: &McpServer) -> bool {\n    s.command.is_none() && s.url.is_some()\n}","tryCatchPattern":"match doctor_check_mcp_server(&server) {\n    McpServerDoctorStatus::Ok(d) => assert!(d.contains(\"HTTP/SSE\"), \"{d}\"),\n    other => panic!(\"Expected Ok, got {other:?}\"),\n}","preventionTips":["Keep doctor checks structural; do not add live network probes for URL servers","Print full status variants in test panics","Assert on stable substrings or update wording tests when copy changes","Isolate tests that could touch localhost ports"],"tags":["rust","testing","mcp","doctor","panic"],"backgroundTag":"unexpected-response-shape","analyzedSha":"433685b2024e7bc4c99e1e2e326bcad39b4d9d65","analyzedAt":"2026-09-15T12:24:24.634Z","contentChangedAt":"2026-09-15T12:24:24.634Z","schemaVersion":2},"datasetVersion":"2026-09-22T10:30:35.592Z"}