mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-10 21:07:53 +00:00
Add Max(timestamp) tests to smoke-test (#2025)
* Add Max(timestamp) tests to smoke-test run a Max() call on a timestamp field twice, and make sure the results are the same * chmod +x
This commit is contained in:
parent
03df1ba6ad
commit
a8c1b93610
2 changed files with 82 additions and 0 deletions
57
qa/testcases/bug-repros/fb-1371-datagen.yaml
Normal file
57
qa/testcases/bug-repros/fb-1371-datagen.yaml
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
fields:
|
||||
- name: "id"
|
||||
type: uint
|
||||
step: 1
|
||||
distribution: "sequential"
|
||||
min: 1
|
||||
max: 200
|
||||
- name: "segid"
|
||||
type: "int" # (default IntField)
|
||||
min: 0
|
||||
max: 3
|
||||
distribution: "zipfian"
|
||||
s: 1.1
|
||||
v: 5.1
|
||||
- name: "ts"
|
||||
type: "timestamp"
|
||||
min_date: 2006-01-02T15:04:05.001Z # RFC3339Nano
|
||||
max_date: 2022-01-02T15:04:05.001Z # RFC3339Nano
|
||||
distribution: "increasing" # only "increasing" is supported right now
|
||||
min_step_duration: "1ms"
|
||||
max_step_duration: "200ms"
|
||||
- name: "lastupdated"
|
||||
type: "timestamp"
|
||||
min_date: 2006-01-02T15:04:05.001Z # RFC3339Nano
|
||||
max_date: 2022-01-02T15:04:05.001Z # RFC3339Nano
|
||||
distribution: "increasing" # only "increasing" is supported right now
|
||||
min_step_duration: "1ms"
|
||||
max_step_duration: "200ms"
|
||||
- name: "slice"
|
||||
type: "uint-set" # (default IDArrayField)
|
||||
min: 0
|
||||
max: 35000
|
||||
distribution: "zipfian"
|
||||
s: 1.1
|
||||
v: 5.1
|
||||
min_num: 1
|
||||
max_num: 50
|
||||
|
||||
idk_params:
|
||||
primary_key_config:
|
||||
field: "id"
|
||||
fields:
|
||||
segid:
|
||||
- type: "ID"
|
||||
ts:
|
||||
- type: "RecordTime"
|
||||
layout: "2006-01-02T15:04:05Z"
|
||||
epoch: 1970-01-01T00:00:00.0Z
|
||||
name: "na"
|
||||
- type: "Timestamp"
|
||||
layout: "2006-01-02T15:04:05Z"
|
||||
epoch: 1970-01-01T00:00:00.0Z
|
||||
name: "last_update"
|
||||
granularity: "s"
|
||||
slice:
|
||||
- type: "IDArray"
|
||||
time_quantum: "D"
|
||||
25
qa/testcases/bug-repros/fb-1371-test.sh
Executable file
25
qa/testcases/bug-repros/fb-1371-test.sh
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
ifErr() {
|
||||
RESCODE=$?
|
||||
if [[ $RESCODE != 0 ]]; then
|
||||
echo $1
|
||||
exit $RESCODE
|
||||
fi
|
||||
}
|
||||
|
||||
/data/datagen_linux_arm64 -s custom --custom-config=./fb-1371-datagen.yaml --pilosa.index=fb1371 --pilosa.batch-size=100 --pilosa.hosts=$1
|
||||
ifErr "datagenning fb1371"
|
||||
|
||||
RES1=$( curl $1/index/fb1371/query -d 'Max(ts)' | jq '.results[0].timestampValue' )
|
||||
ifErr "getting Max 1"
|
||||
|
||||
RES2=$( curl $1/index/fb1371/query -d 'Max(ts)' | jq '.results[0].timestampValue' )
|
||||
ifErr "getting Max 2"
|
||||
|
||||
if [[ $RES1 != $RES2 ]]; then
|
||||
echo "different Max after two calls"
|
||||
echo "first: $RES1"
|
||||
echo "second: $RES2"
|
||||
exit 1
|
||||
fi
|
||||
Loading…
Add table
Reference in a new issue