From 682eb906541c0203efb6fb4005f01027f5151a1d Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 13 Mar 2023 11:44:10 +0200 Subject: [PATCH] adjust coalescer delays --- chain/index/msgindex.go | 6 +++--- chain/index/msgindex_test.go | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/chain/index/msgindex.go b/chain/index/msgindex.go index 64dfcac67..4b484ca50 100644 --- a/chain/index/msgindex.go +++ b/chain/index/msgindex.go @@ -53,9 +53,9 @@ const ( // coalescer configuration (TODO: use observer instead) var ( - coalesceMinDelay = 100 * time.Millisecond - coalesceMaxDelay = time.Second - coalesceMergeInterval = 100 * time.Millisecond + coalesceMinDelay = time.Second + coalesceMaxDelay = 15 * time.Second + coalesceMergeInterval = time.Second ) // chain store interface; we could use store.ChainStore directly, diff --git a/chain/index/msgindex_test.go b/chain/index/msgindex_test.go index bcca8ce1f..07fdbdc8e 100644 --- a/chain/index/msgindex_test.go +++ b/chain/index/msgindex_test.go @@ -198,6 +198,12 @@ var rng *rand.Rand func init() { systemAddr, _ = address.NewIDAddress(0) rng = rand.New(rand.NewSource(314159)) + + // adjust those to make tests snappy + coalesceMinDelay = time.Millisecond + coalesceMaxDelay = 10 * time.Millisecond + coalesceMergeInterval = time.Millisecond + } func newMockChainStore() *mockChainStore {