{"record":{"id":"7300f9fc23c868e9","repo":"apache/beam","slug":"d-missing-entries-missing-in-actual-present-in-expected","errorCode":null,"errorMessage":"%d missing entries (missing in actual, present in expected)","messagePattern":"(.+?) missing entries \\(missing in actual, present in expected\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/testing/passert/equals.go","lineNumber":104,"sourceCode":"\t\t\"actual PCollection does not match expected values\",\n\t\tpartSeparator,\n\t\tfmt.Sprintf(\"%d correct entries (present in both)\", goodCount),\n\t\tpartSeparator,\n\t\tfmt.Sprintf(\"%d unexpected entries (present in actual, missing in expected)\", len(unexpectedStrings)),\n\t}\n\tfor _, entry := range unexpectedStrings {\n\t\toutStrings = append(outStrings, \"+++\", entry)\n\t}\n\n\toutStrings = append(\n\t\toutStrings,\n\t\tpartSeparator,\n\t\tfmt.Sprintf(\"%d missing entries (missing in actual, present in expected)\", len(missingStrings)),\n\t)\n\tfor _, entry := range missingStrings {\n\t\toutStrings = append(outStrings, \"---\", entry)\n\t}\n\treturn errors.New(strings.Join(outStrings, \"\\n\"))\n}\n\nfunc readToStrings(iter func(*beam.T) bool) []string {\n\tout := []string{}\n\tvar inVal beam.T\n\tfor iter(&inVal) {\n\t\tout = append(out, fmt.Sprint(inVal))\n\t}\n\tsort.Strings(out)\n\treturn out\n}\n","sourceCodeStart":86,"sourceCodeEnd":116,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/testing/passert/equals.go#L86-L116","documentation":"passert.Equals (and its float/string variants) compare an observed PCollection against an expected one by stringifying elements. failIfBadEntries builds a diagnostic report; when actual values lack entries present in the expected set, it produces 'N missing entries (missing in actual, present in expected)' followed by each missing entry. It is a test-assertion failure meaning your pipeline produced a different result set than expected.","triggerScenarios":"Calling passert.Equals(s, col, expectedList) in tests where the pipeline output omits one or more expected values — wrong windowing, filtering, dedup, or side-input logic.","commonSituations":"Beam pipeline unit tests failing after logic changes; nondeterministic pipelines dropping elements; windowing/timestamp issues causing elements to be dropped at window boundaries.","solutions":["Read the entries listed after '---' in the error to see exactly which values are missing","Fix the transform logic that drops those elements (filters, windows, dedup)","Verify windowing and triggering so elements are not lost before the assertion","Confirm expected values match the actual element encoding (stringification)"],"exampleFix":"// before\n// test fails: 1 missing entries (missing in actual, present in expected)\n// --- world\npassert.Equals(s, words, \"hello\", \"world\") // but 'world' was filtered out\n// after\nwords = beam.ParDo(s, &removeStopWordsFn{}, words) // fix the filter so 'world' survives\npassert.Equals(s, words, \"hello\", \"world\")","handlingStrategy":"validation","validationCode":"// sanity-check expected contents before asserting\nif len(expected) == 0 {\n\tt.Fatal(\"expected list must not be empty for passert.Equals\")\n}","typeGuard":null,"tryCatchPattern":"if err := passert.Equals(s, col, expected); err != nil {\n\t// err text lists missing entries after '---'; dump observed for diffing\n\tt.Fatalf(\"passert failed: %v\", err)\n}","preventionTips":["Compare the '---' listed entries against your pipeline output","Check windowing/triggering so elements aren't dropped before assertions","Use deterministic transforms in test pipelines","Verify element stringification matches expected string values"],"tags":["go","beam","testing","passert"],"backgroundTag":"schema-validation-failed","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}