func (s *AdminSuite) TestGetOffsetsAfterProduce(c *C) {
	keyToCount := make(map[string]int, 64)
	for i := 0; i < 64; i++ {
		keyToCount[strconv.Itoa(i)] = i
	}
	a, err := Spawn(s.ns, s.cfg)
	c.Assert(err, IsNil)
	offsetsBefore, err := a.GetGroupOffsets("foo", "test.64")
	c.Assert(err, IsNil)
	s.kh.PutMessages("get_offsets", "test.64", keyToCount)
	_, _ = a.GetGroupOffsets("foo", "test.64")
	offsetsAfter, err := a.GetGroupOffsets("foo", "test.64")
	c.Assert(err, IsNil)
	rangeEndDiffs := []int{
		0, 75, 3, 0, 57, 0, 0, 8, 58, 6, 30, 59, 0, 75, 63, 0, 48, 37, 49, 0,
		75, 2, 0, 51, 0, 0, 0, 79, 1, 33, 61, 39, 75, 62, 0, 4, 36, 0, 0, 79,
		61, 28, 53, 35, 18, 0, 79, 0, 32, 63, 38, 0, 9, 59, 7, 31, 14, 0, 79, 60,
		29, 55, 34, 67,
	}
	for i := 0; i < 64; i++ {
		actualDiff := int(offsetsAfter[i].End - offsetsBefore[i].End)
		if actualDiff != rangeEndDiffs[i] {
			c.Errorf("partition %d, want=%d, got=%d", i, rangeEndDiffs[i], actualDiff)
		}
	}
	a.Stop()
}
The end offset of partition ranges is properly reflects the number of
messages produced since the previous check.
package admin
import (
	"strconv"
	"testing"
	"github.com/mailgun/kafka-pixy/actor"
	"github.com/mailgun/kafka-pixy/config"
	"github.com/mailgun/kafka-pixy/testhelpers"
	"github.com/mailgun/kafka-pixy/testhelpers/kafkahelper"
	. "gopkg.in/check.v1"
)
func Test(t *testing.T) {
	TestingT(t)
}
type AdminSuite struct {
	ns  *actor.Descriptor
	cfg *config.Proxy
	kh  *kafkahelper.T
}
var _ = Suite(&AdminSuite{})
func (s *AdminSuite) SetUpSuite(c *C) {
	testhelpers.InitLogging()
	s.cfg = config.DefaultProxy()
	s.cfg.ClientID = "producer"
	s.cfg.Kafka.SeedPeers = testhelpers.KafkaPeers
	s.cfg.ZooKeeper.SeedPeers = testhelpers.ZookeeperPeers
	s.kh = kafkahelper.New(c)
}
func (s *AdminSuite) TearDownSuite(c *C) {
	s.kh.Close()
}
func (s *AdminSuite) SetUpTest(c *C) {
	s.ns = actor.Root().NewChild("T")
}