VOL-2227:Fix for Max PON Ports

Change-Id: I093c3a4cf1726cf7f94cf8833d1e8a4e775c762b
diff --git a/adaptercore/device_handler_test.go b/adaptercore/device_handler_test.go
index 588796c..26b86ba 100644
--- a/adaptercore/device_handler_test.go
+++ b/adaptercore/device_handler_test.go
@@ -189,7 +189,19 @@
 	dh.eventMgr = &OpenOltEventMgr{eventProxy: &mocks.MockEventProxy{}}
 	dh.transitionMap = &TransitionMap{}
 	dh.portStats = &OpenOltStatisticsMgr{}
-	dh.metrics = &pmmetrics.PmMetrics{}
+
+	var pmNames = []string{
+		"rx_bytes",
+		"rx_packets",
+		"rx_mcast_packets",
+		"rx_bcast_packets",
+		"tx_bytes",
+		"tx_packets",
+		"tx_mcast_packets",
+		"tx_bcast_packets",
+	}
+
+	dh.metrics = pmmetrics.NewPmMetrics(device.Id, pmmetrics.Frequency(2), pmmetrics.FrequencyOverride(false), pmmetrics.Grouped(false), pmmetrics.Metrics(pmNames))
 	return dh
 }
 
@@ -1071,7 +1083,7 @@
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
 			go func() {
-				time.Sleep(2 * time.Minute)
+				time.Sleep(66 * time.Second) // startCollector inside waits for 1 min, so we stop it after 6 secs of running
 				tt.args.dh.stopCollector <- true
 			}()
 			startCollector(tt.args.dh)