apache/beam · error · AssertionError
Unexpected progress shape
Error message
Unexpected progress shape: %s
What it means
SyntheticBoundedSource's reader supports configurable progress-reporting shapes (LINEAR, LINEAR_REGRESSING) used to test runner watermark/fraction-consumed handling. getFractionConsumed() throws AssertionError when the configured SyntheticOptions progress shape is not one of the supported enum values, indicating an internal invariant violation or an added enum case not handled in the switch.
Solutions
- Inspect the SyntheticOptions in your test pipeline and set the progress shape to LINEAR or LINEAR_REGRESSING.
- Fix the options JSON/flag so the parsed enum matches a supported value (watch for typos or parsing producing an unexpected default).
- If you added a new shape enum value, add the corresponding case to getFractionConsumed().
Example fix
// before (options JSON)
{"numRecords": 1000, "progressShape": "EXPONENTIAL"}
// after
{"numRecords": 1000, "progressShape": "LINEAR"} Defensive patterns
Strategy: validation
Validate before calling
// Java — validate progress shape before launching synthetic pipeline
String shape = optionsJson.get("progressShape").asText();
if (!shape.equals("LINEAR") && !shape.equals("LINEAR_REGRESSING")) {
throw new IllegalArgumentException("Unsupported progressShape: " + shape);
} Prevention
- Only use progress shapes documented for your Beam version (LINEAR, LINEAR_REGRESSING).
- Copy option JSON from the matching Beam version's test resources.
- If extending the enum, update every switch over it.
When it happens
Trigger: Setting a progress shape in SyntheticOptions (e.g., via synthetic source options JSON in test pipelines) that is neither LINEAR nor LINEAR_REGRESSING, then having the runner call getFractionConsumed(); also hit when a new ProgressDirection enum value is added without updating this switch.
Common situations: Running Beam perf-test harnesses with synthetic source option JSON specifying an unsupported/typo'd shape; internal Beam development when extending progress directions.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- Current record is unavailable because either the reader is…
- Current timestamp is unavailable because either the reader…
- The current element is unavailable because either the…
- Unable to locate declared method.
- Unknown delay type
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/6bb18f6bfdeca090.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/java/io/synthetic/src/main/java/org/apache/beam/sdk/io/synthetic/SyntheticBoundedSource.java:248
return true;
}
private boolean shouldSourceSplit() {
return (splitPointFrequencyRecords == 0) || (currentOffset % splitPointFrequencyRecords == 0);
}
@Override
public Double getFractionConsumed() {
double realFractionConsumed = super.getFractionConsumed();
SyntheticSourceOptions.ProgressShape shape = getCurrentSource().sourceOptions.progressShape;
switch (shape) {
case LINEAR:
return realFractionConsumed;
case LINEAR_REGRESSING:
return 0.9 - 0.8 * realFractionConsumed;
default:
throw new AssertionError("Unexpected progress shape: " + shape);
}
}
@Override
protected boolean isAtSplitPoint() throws NoSuchElementException {
return isAtSplitPoint;
}
@Override
public void close() {
// Nothing
}
}
}
View on GitHub (pinned to 12126d8942)