@@ -122,7 +122,7 @@ func ChannelManager_Clear(t *testing.T, batchType uint) {
122
122
// clearing confirmed transactions, and resetting the pendingChannels map
123
123
cfg .ChannelTimeout = 10
124
124
cfg .InitRatioCompressor (1 , derive .Zlib )
125
- m := NewChannelManager (log , metrics .NoopMetrics , cfg , defaultTestRollupConfig )
125
+ m := NewChannelManager (log , metrics .NewMetrics ( "test" ) , cfg , defaultTestRollupConfig )
126
126
127
127
// Channel Manager state should be empty by default
128
128
require .Empty (m .blocks )
@@ -150,7 +150,6 @@ func ChannelManager_Clear(t *testing.T, batchType uint) {
150
150
151
151
// Process the blocks
152
152
// We should have a pending channel with 1 frame
153
-
154
153
require .NoError (m .processBlocks ())
155
154
require .NoError (m .currentChannel .channelBuilder .co .Flush ())
156
155
require .NoError (m .outputFrames ())
@@ -174,6 +173,11 @@ func ChannelManager_Clear(t *testing.T, batchType uint) {
174
173
safeL1Origin := eth.BlockID {
175
174
Number : 123 ,
176
175
}
176
+
177
+ // Artificially pump up some metrics which need to be cleared
178
+ m .metr .RecordL2BlockInPendingQueue (a )
179
+ require .NotZero (m .metr .PendingDABytes ())
180
+
177
181
// Clear the channel manager
178
182
m .Clear (safeL1Origin )
179
183
@@ -184,6 +188,7 @@ func ChannelManager_Clear(t *testing.T, batchType uint) {
184
188
require .Nil (m .currentChannel )
185
189
require .Empty (m .channelQueue )
186
190
require .Empty (m .txChannels )
191
+ require .Zero (m .metr .PendingDABytes ())
187
192
}
188
193
189
194
func ChannelManager_TxResend (t * testing.T , batchType uint ) {
0 commit comments