Skip to content

Commit 3a8fc2c

Browse files
change for smoke test
1. sleep from 1 to 2 mins 2. query duration from 10 to 30 mins
1 parent ea1d7df commit 3a8fc2c

File tree

2 files changed

+9
-29
lines changed

2 files changed

+9
-29
lines changed

quest_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ func TestSmokeLoadWithK6Stream(t *testing.T) {
255255
cmd.Run()
256256
cmd.Output()
257257
}
258-
time.Sleep(60 * time.Second)
258+
time.Sleep(120 * time.Second)
259259
QueryLogStreamCount(t, NewGlob.QueryClient, NewGlob.Stream, 60000)
260260
AssertStreamSchema(t, NewGlob.QueryClient, NewGlob.Stream, SchemaBody)
261261
DeleteStream(t, NewGlob.QueryClient, NewGlob.Stream)
@@ -320,7 +320,7 @@ func TestSmokeLoad_CustomPartition_WithK6Stream(t *testing.T) {
320320
cmd.Run()
321321
cmd.Output()
322322
}
323-
time.Sleep(60 * time.Second)
323+
time.Sleep(120 * time.Second)
324324
QueryLogStreamCount(t, NewGlob.QueryClient, custom_partition_stream, 60000)
325325
DeleteStream(t, NewGlob.QueryClient, custom_partition_stream)
326326
}
@@ -352,7 +352,7 @@ func TestSmokeLoad_TimeAndCustomPartition_WithK6Stream(t *testing.T) {
352352
cmd.Run()
353353
cmd.Output()
354354
}
355-
time.Sleep(60 * time.Second)
355+
time.Sleep(120 * time.Second)
356356
QueryLogStreamCount(t, NewGlob.QueryClient, custom_partition_stream, 60000)
357357
DeleteStream(t, NewGlob.QueryClient, custom_partition_stream)
358358
}

test_utils.go

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -246,29 +246,9 @@ func IngestOneEventForStaticSchemaStream_SameFieldsInLog(t *testing.T, client HT
246246
}
247247

248248
func QueryLogStreamCount(t *testing.T, client HTTPClient, stream string, count uint64) {
249-
// Query last 10 minutes of data only
249+
// Query last 30 minutes of data only
250250
endTime := time.Now().Add(time.Second).Format(time.RFC3339Nano)
251-
startTime := time.Now().Add(-10 * time.Minute).Format(time.RFC3339Nano)
252-
253-
query := map[string]interface{}{
254-
"query": "select count(*) as count from " + stream,
255-
"startTime": startTime,
256-
"endTime": endTime,
257-
}
258-
queryJSON, _ := json.Marshal(query)
259-
req, _ := client.NewRequest("POST", "query", bytes.NewBuffer(queryJSON))
260-
response, err := client.Do(req)
261-
require.NoErrorf(t, err, "Request failed: %s", err)
262-
body := readAsString(response.Body)
263-
require.Equalf(t, 200, response.StatusCode, "Server returned http code: %s and response: %s", response.Status, body)
264-
expected := fmt.Sprintf(`[{"count":%d}]`, count)
265-
require.Equalf(t, expected, body, "Query count incorrect; Expected %s, Actual %s", expected, body)
266-
}
267-
268-
func QueryLogStreamCount_WithTimePartition(t *testing.T, client HTTPClient, stream string, count uint64) {
269-
// Query last 10 minutes of data only
270-
endTime := "2024-05-17T10:00:00.000Z"
271-
startTime := "2024-05-17T08:00:00.000Z"
251+
startTime := time.Now().Add(-30 * time.Minute).Format(time.RFC3339Nano)
272252

273253
query := map[string]interface{}{
274254
"query": "select count(*) as count from " + stream,
@@ -286,9 +266,9 @@ func QueryLogStreamCount_WithTimePartition(t *testing.T, client HTTPClient, stre
286266
}
287267

288268
func QueryTwoLogStreamCount(t *testing.T, client HTTPClient, stream1 string, stream2 string, count uint64) {
289-
// Query last 10 minutes of data only
269+
// Query last 30 minutes of data only
290270
endTime := time.Now().Add(time.Second).Format(time.RFC3339Nano)
291-
startTime := time.Now().Add(-10 * time.Minute).Format(time.RFC3339Nano)
271+
startTime := time.Now().Add(-30 * time.Minute).Format(time.RFC3339Nano)
292272

293273
query := map[string]interface{}{
294274
"query": fmt.Sprintf("select sum(c) as count from (select count(*) as c from %s union all select count(*) as c from %s)", stream1, stream2),
@@ -306,9 +286,9 @@ func QueryTwoLogStreamCount(t *testing.T, client HTTPClient, stream1 string, str
306286
}
307287

308288
func AssertQueryOK(t *testing.T, client HTTPClient, query string, args ...any) {
309-
// Query last 10 minutes of data only
289+
// Query last 30 minutes of data only
310290
endTime := time.Now().Add(time.Second).Format(time.RFC3339Nano)
311-
startTime := time.Now().Add(-10 * time.Minute).Format(time.RFC3339Nano)
291+
startTime := time.Now().Add(-30 * time.Minute).Format(time.RFC3339Nano)
312292

313293
var finalQuery string
314294
if len(args) == 0 {

0 commit comments

Comments
 (0)