Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: AutoTestCI
on: [push, pull_request]
on: [push, pull_request, workflow_dispatch]
jobs:
test:
name: "AutoTest (GRAN=${{ matrix.write_gran }})"
Expand Down
19 changes: 18 additions & 1 deletion tests/fdb_tsdb_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@
#define TEST_ITER1_SECTORS 5
#define TEST_ITER1_COUNT (TEST_ITER1_SECTORS * _TSIL_PER_SECTOR)

/* TSLs per sector when blob is logbuf-sized string */
#define _TSIL_LOGBUF_ALIGN_SZ FDB_WG_ALIGN(sizeof(logbuf))
#define _TSIL_PER_SECTOR_STR ((TEST_SECTOR_SIZE - _TSIL_SEC_HDR_SZ) \
/ (_TSIL_IDX_DATA_SZ + _TSIL_LOGBUF_ALIGN_SZ))

/* Cap at 256 to avoid timeout on small write granularities (e.g. gran=1/8/32),
* while still being dynamic enough to avoid ring-buffer wrap-around on large
* granularities (e.g. gran=64/128/256). */
#define TEST_TS_COUNT ((_TSIL_PER_SECTOR_STR * 14) < 256 \
? (_TSIL_PER_SECTOR_STR * 14) : 256)


struct test_tls_data {
int data;
fdb_time_t time;
Expand Down Expand Up @@ -153,9 +165,14 @@ static void test_fdb_tsl_iter_by_time(void)
static void test_fdb_tsl_query_count(void)
{
fdb_time_t from = 0, to = TEST_TS_COUNT * TEST_TIME_STEP;
uint32_t count;

fdb_reboot();
uassert_true(fdb_tsl_query_count(&test_tsdb, from, to, FDB_TSL_WRITE) == TEST_TS_COUNT);
count = fdb_tsl_query_count(&test_tsdb, from, to, FDB_TSL_WRITE);
rt_kprintf("query_count from=%d to=%d => %u, expected=%u\n",
(int)from, (int)to, (unsigned)count, TEST_TS_COUNT);

uassert_true(count == TEST_TS_COUNT);
}

static bool est_fdb_tsl_set_status_cb(fdb_tsl_t tsl, void *arg)
Expand Down