MCPcopy
hub / github.com/IBM/sarama / TestPartitionOffsetManagerMarkOffset

Function TestPartitionOffsetManagerMarkOffset

offset_manager_test.go:722–745  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

720}
721
722func TestPartitionOffsetManagerMarkOffset(t *testing.T) {
723 om, testClient, broker, coordinator := initOffsetManager(t, 0)
724 defer broker.Close()
725 defer coordinator.Close()
726 pom := initPartitionOffsetManager(t, om, coordinator, 5, "original_meta")
727
728 ocResponse := new(OffsetCommitResponse)
729 ocResponse.AddError("my_topic", 0, ErrNoError)
730 coordinator.Returns(ocResponse)
731
732 pom.MarkOffset(100, "modified_meta")
733 offset, meta := pom.NextOffset()
734
735 if offset != 100 {
736 t.Errorf("Expected offset 100. Actual: %v", offset)
737 }
738 if meta != "modified_meta" {
739 t.Errorf("Expected metadata \"modified_meta\". Actual: %q", meta)
740 }
741
742 safeClose(t, pom)
743 safeClose(t, om)
744 safeClose(t, testClient)
745}
746
747func TestPartitionOffsetManagerMarkOffsetWithRetention(t *testing.T) {
748 om, testClient, broker, coordinator := initOffsetManager(t, time.Hour)

Callers

nothing calls this directly

Calls 9

initOffsetManagerFunction · 0.85
ReturnsMethod · 0.80
safeCloseFunction · 0.70
CloseMethod · 0.65
MarkOffsetMethod · 0.65
NextOffsetMethod · 0.65
ErrorfMethod · 0.65
AddErrorMethod · 0.45

Tested by

no test coverage detected