Class FromEndOffsetSpec
Verifies that a read journal honors the FromEnd ("last N events") query
offset, which begins a query at the Nth event from the end of history rather than from the beginning.
This is the cross-backend contract for FromEnd. It exercises the full
matrix of {by-tag, all-events} × {current, live} against an interleaved, multi-persistence-id
fixture that mixes tagged and untagged events. The interleaving is deliberate: a single-persistence-id fixture
cannot distinguish a backend that resolves the from-end position correctly (per-tag count for by-tag queries,
total count for all-events queries) from one that naively resolves both against a single global ordinal,
because the two coincide only when there is one writer and every event carries the tag. The
...should_count_per_tag_... test pins exactly that distinction.
Only read journals that support FromEnd should inherit from this spec.
Backends that cannot resolve a from-the-end position (e.g. those without a global ordering) should not opt in.
A backend must also implement the current counterpart of every query it supports here, since the spec
uses the current queries to confirm writes are visible before resolving a from-end window. Individual tests are
virtual so a backend can override or skip the dimensions it does not implement.
Inheritance
FromEndOffsetSpec
Assembly: Akka.Persistence.TCK.dll
Syntax
public abstract class FromEndOffsetSpec : TestKit, IActorRefFactory, IDisposable
Constructors
|
Edit this page
View Source
FromEndOffsetSpec(Config?, string?, ITestOutputHelper?)
Declaration
protected FromEndOffsetSpec(Config? config = null, string? actorSystemName = null, ITestOutputHelper? output = null)
Parameters
| Type |
Name |
Description |
| Config |
config |
|
| string |
actorSystemName |
|
| ITestOutputHelper |
output |
|
Fields
|
Edit this page
View Source
AllEvents
Every fixture event in global (ordering) order, as (persistenceId, sequenceNr) pairs.
Declaration
protected static readonly (string PersistenceId, long SequenceNr)[] AllEvents
Field Value
|
Edit this page
View Source
GreenEvents
The subset of AllEvents tagged "green", in global order — derived from the fixture text so it
can never drift from the writes.
Declaration
protected static readonly (string PersistenceId, long SequenceNr)[] GreenEvents
Field Value
Properties
|
Edit this page
View Source
Materializer
Declaration
protected ActorMaterializer Materializer { get; }
Property Value
|
Edit this page
View Source
ReadJournal
Declaration
protected IReadJournal? ReadJournal { get; set; }
Property Value
Methods
|
Edit this page
View Source
ReadJournal_FromEnd_should_count_per_tag_for_by_tag_and_all_events_for_all_events()
Declaration
[Fact("D:\\a\\1\\s\\src\\core\\Akka.Persistence.TCK\\Query\\FromEndOffsetSpec.cs", 225)]
public virtual Task ReadJournal_FromEnd_should_count_per_tag_for_by_tag_and_all_events_for_all_events()
Returns
|
Edit this page
View Source
ReadJournal_live_query_AllEvents_with_FromEnd_should_return_last_N_then_new_events()
Declaration
[Fact("D:\\a\\1\\s\\src\\core\\Akka.Persistence.TCK\\Query\\FromEndOffsetSpec.cs", 200)]
public virtual Task ReadJournal_live_query_AllEvents_with_FromEnd_should_return_last_N_then_new_events()
Returns
|
Edit this page
View Source
ReadJournal_live_query_EventsByTag_with_FromEnd_should_return_last_N_then_new_events()
Declaration
[Fact("D:\\a\\1\\s\\src\\core\\Akka.Persistence.TCK\\Query\\FromEndOffsetSpec.cs", 128)]
public virtual Task ReadJournal_live_query_EventsByTag_with_FromEnd_should_return_last_N_then_new_events()
Returns
|
Edit this page
View Source
ReadJournal_query_CurrentAllEvents_with_FromEnd_larger_than_total_should_return_all_events()
Declaration
[Fact("D:\\a\\1\\s\\src\\core\\Akka.Persistence.TCK\\Query\\FromEndOffsetSpec.cs", 170)]
public virtual Task ReadJournal_query_CurrentAllEvents_with_FromEnd_larger_than_total_should_return_all_events()
Returns
|
Edit this page
View Source
ReadJournal_query_CurrentAllEvents_with_FromEnd_on_empty_journal_should_complete_empty()
Declaration
[Fact("D:\\a\\1\\s\\src\\core\\Akka.Persistence.TCK\\Query\\FromEndOffsetSpec.cs", 185)]
public virtual Task ReadJournal_query_CurrentAllEvents_with_FromEnd_on_empty_journal_should_complete_empty()
Returns
|
Edit this page
View Source
ReadJournal_query_CurrentAllEvents_with_FromEnd_should_return_only_the_last_N_events()
Declaration
[Fact("D:\\a\\1\\s\\src\\core\\Akka.Persistence.TCK\\Query\\FromEndOffsetSpec.cs", 154)]
public virtual Task ReadJournal_query_CurrentAllEvents_with_FromEnd_should_return_only_the_last_N_events()
Returns
|
Edit this page
View Source
ReadJournal_query_CurrentEventsByTag_with_FromEnd_and_no_matching_events_should_complete_empty()
Declaration
[Fact("D:\\a\\1\\s\\src\\core\\Akka.Persistence.TCK\\Query\\FromEndOffsetSpec.cs", 91)]
public virtual Task ReadJournal_query_CurrentEventsByTag_with_FromEnd_and_no_matching_events_should_complete_empty()
Returns
|
Edit this page
View Source
ReadJournal_query_CurrentEventsByTag_with_FromEnd_larger_than_total_should_return_all_events()
Declaration
[Fact("D:\\a\\1\\s\\src\\core\\Akka.Persistence.TCK\\Query\\FromEndOffsetSpec.cs", 76)]
public virtual Task ReadJournal_query_CurrentEventsByTag_with_FromEnd_larger_than_total_should_return_all_events()
Returns
|
Edit this page
View Source
ReadJournal_query_CurrentEventsByTag_with_FromEnd_should_resolve_a_deep_window_in_a_long_history()
Declaration
[Fact("D:\\a\\1\\s\\src\\core\\Akka.Persistence.TCK\\Query\\FromEndOffsetSpec.cs", 104)]
public virtual Task ReadJournal_query_CurrentEventsByTag_with_FromEnd_should_resolve_a_deep_window_in_a_long_history()
Returns
|
Edit this page
View Source
ReadJournal_query_CurrentEventsByTag_with_FromEnd_should_return_only_the_last_N_events()
Declaration
[Fact("D:\\a\\1\\s\\src\\core\\Akka.Persistence.TCK\\Query\\FromEndOffsetSpec.cs", 60)]
public virtual Task ReadJournal_query_CurrentEventsByTag_with_FromEnd_should_return_only_the_last_N_events()
Returns
Implements
Extension Methods