Skip to content

tests: a second seed for the calendar factories' refusals, and a join case for E76 #451

Closed

Description

@CaffeinatedCoder

Found by a review of #191 (main PR #447 @ 879c82a, release/10.x PR #449 @ 684216b), checked on PostgreSQL 16.15 and 18.1.

Problem

  1. The one seed proves only the extremes half of CalendarFactoryParityTests. calendar-last-period-ends-on-a-day-not-infinity.patch breaks the last period's constant. Nothing proves the refusal half, CalendarFactories_OverAnArgumentMemoryRefuses_RaiseInPostgres, which is the half most likely to go vacuous: it accepts three SQLSTATEs, and its Where form passes if any row raises. A second seed in MondayOf (ValueRangesMethodCallTranslator.cs) shows the class is real and is caught by that test alone:

    - sqlExpressionFactory.LessThanOrEqual(week, weeks)
    + sqlExpressionFactory.LessThanOrEqual(week, sqlExpressionFactory.Add(weeks, Int(1)))

    With it, week 53 of a 52-week year rolls over to the next year's week 1. On main @ 7503c18, PostgreSQL 16:

    Failed CalendarFactories_OverAnArgumentMemoryRefuses_RaiseInPostgres
    IsoWeek(2025, 53) Select: the server answered, where memory throws
    IsoWeek(2025, 53) Where: the server answered, where memory throws
    Failed: 1, Passed: 2
    

    The class's other two tests pass with the seed.

  2. "Filter, join and sort by it" isn't held for the join. docs/efcore.md#what-runs-where claims a join (quoted by E76), but neither E76's claim nor any test covers one. It works: a join on DateRange.Month(x.Day) == DateRange.Month(y.Y, m) over both extremes gives the 1,365 rows memory gives. So this is a gap, not a bug.

  3. Cosmetic: the seed patch repeats its diff --git header line, the only seed in test/oracles/seeds/ that does. git apply accepts it.

Change

  • Add the seed above as test/oracles/seeds/calendar-iso-week-53-of-a-52-week-year-rolls-over.patch, with Oracles: CalendarFactoryParityTests. Then run dotnet run tools/oracles.cs seeds calendar on both lines.
  • Add a join case to CalendarFactoryParityTests that compares with memory at both extremes, and add "a join" to E76's claim. Or drop "join" from the doc.
  • Remove the duplicate header line from the existing seed.

Test

The new seed fails CalendarFactories_OverAnArgumentMemoryRefuses_RaiseInPostgres and nothing else. That is the proof verify-the-guard asks for.

Activity

  1. added this to the 10.3.0 milestone on Oct 25, 2026
  2. added
    testsAdds or changes tests only (oracles, harnesses); no library code
    area/rangesRange unions, variants and the shape engines
    package/efcoreAffects CodoMetis.ValueRanges.EFCore.PostgreSQL
    on Oct 25, 2026
  3. CaffeinatedCoder commented on Oct 25, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Fixed in #456 (main, stacked on #455) and #459 (release/10.x, stacked on #458). The new seed fails CalendarFactories_OverAnArgumentMemoryRefuses_RaiseInPostgres alone. The new join test (Month, Quarter and Year, a date form against an integer form, with the extremes required to find a partner) is also caught by the existing seed, whose Fails: line now says so. dotnet run tools/oracles.cs seeds calendar reports every seed is caught on both lines. Close by hand once both merge.

  4. added a commit that references this issue on Oct 25, 2026
  5. CaffeinatedCoder commented on Oct 25, 2026

    @CaffeinatedCoder
    OwnerAuthor

    Merged on both lines; #459 was the release/10.x PR. Closed by hand, since Closes acts only on main.

  6. added a commit that references this issue on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/rangesRange unions, variants and the shape enginespackage/efcoreAffects CodoMetis.ValueRanges.EFCore.PostgreSQLtestsAdds or changes tests only (oracles, harnesses); no library code

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions