Prechádzať zdrojové kódy

test(table): move mock data sending wait time to the beginning to let table run firstly

ngjaying 4 rokov pred
rodič
commit
c230450656
1 zmenil súbory, kde vykonal 1 pridanie a 1 odobranie
  1. 1 1
      xstream/topotest/mock_topo.go

+ 1 - 1
xstream/topotest/mock_topo.go

@@ -1092,6 +1092,7 @@ func sendData(t *testing.T, dataLength int, metrics map[string]interface{}, data
 	// TODO assume multiple data source send the data in order and has the same length
 	for i := 0; i < dataLength; i++ {
 		for _, d := range datas {
+			time.Sleep(time.Duration(wait) * time.Millisecond)
 			// Make sure time is going forward only
 			// gradually add up time to ensure checkpoint is triggered before the data send
 			for n := common.GetNowInMilli() + 100; d[i].Timestamp+100 > n; n += 100 {
@@ -1109,7 +1110,6 @@ func sendData(t *testing.T, dataLength int, metrics map[string]interface{}, data
 				return err
 			default:
 			}
-			time.Sleep(time.Duration(wait) * time.Millisecond)
 		}
 	}
 	mockClock.Add(time.Duration(postleap) * time.Millisecond)