mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-21 05:04:32 +08:00
Make bgw_reorder_drop_chunks test output reproducable
The test output from bgw_reorder_drop_chunks depends on timing making the test output differ in slower test environments. This patch truncates the timing information with time_bucket.
This commit is contained in:
parent
3082c5bb8b
commit
53753abdf9
@ -497,12 +497,12 @@ SELECT * FROM _timescaledb_config.bgw_job where id=:drop_chunks_job_id;
|
|||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- job ran once, successfully
|
-- job ran once, successfully
|
||||||
SELECT job_id, next_start, last_finish as until_next, last_run_success, total_runs, total_successes, total_failures, total_crashes
|
SELECT job_id, time_bucket('1m',next_start) AS next_start, time_bucket('1m',last_finish) as until_next, last_run_success, total_runs, total_successes, total_failures, total_crashes
|
||||||
FROM _timescaledb_internal.bgw_job_stat
|
FROM _timescaledb_internal.bgw_job_stat
|
||||||
where job_id=:drop_chunks_job_id;
|
where job_id=:drop_chunks_job_id;
|
||||||
job_id | next_start | until_next | last_run_success | total_runs | total_successes | total_failures | total_crashes
|
job_id | next_start | until_next | last_run_success | total_runs | total_successes | total_failures | total_crashes
|
||||||
--------+------------------------------+------------------------------+------------------+------------+-----------------+----------------+---------------
|
--------+------------------------------+------------------------------+------------------+------------+-----------------+----------------+---------------
|
||||||
1001 | Fri Dec 31 16:00:01 1999 PST | Fri Dec 31 16:00:00 1999 PST | t | 1 | 1 | 0 | 0
|
1001 | Fri Dec 31 16:00:00 1999 PST | Fri Dec 31 16:00:00 1999 PST | t | 1 | 1 | 0 | 0
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- chunks 8 and 10 dropped
|
-- chunks 8 and 10 dropped
|
||||||
@ -536,12 +536,12 @@ SELECT * FROM _timescaledb_config.bgw_job where id=:drop_chunks_job_id;
|
|||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- still only 1 run
|
-- still only 1 run
|
||||||
SELECT job_id, next_start, last_finish as until_next, last_run_success, total_runs, total_successes, total_failures, total_crashes
|
SELECT job_id, time_bucket('1m',next_start) AS next_start, time_bucket('1m',last_finish) as until_next, last_run_success, total_runs, total_successes, total_failures, total_crashes
|
||||||
FROM _timescaledb_internal.bgw_job_stat
|
FROM _timescaledb_internal.bgw_job_stat
|
||||||
where job_id=:drop_chunks_job_id;
|
where job_id=:drop_chunks_job_id;
|
||||||
job_id | next_start | until_next | last_run_success | total_runs | total_successes | total_failures | total_crashes
|
job_id | next_start | until_next | last_run_success | total_runs | total_successes | total_failures | total_crashes
|
||||||
--------+------------------------------+------------------------------+------------------+------------+-----------------+----------------+---------------
|
--------+------------------------------+------------------------------+------------------+------------+-----------------+----------------+---------------
|
||||||
1001 | Fri Dec 31 16:00:01 1999 PST | Fri Dec 31 16:00:00 1999 PST | t | 1 | 1 | 0 | 0
|
1001 | Fri Dec 31 16:00:00 1999 PST | Fri Dec 31 16:00:00 1999 PST | t | 1 | 1 | 0 | 0
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- same chunks
|
-- same chunks
|
||||||
@ -588,12 +588,12 @@ SELECT * FROM _timescaledb_config.bgw_job where id=:drop_chunks_job_id;
|
|||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- 2 runs
|
-- 2 runs
|
||||||
SELECT job_id, next_start, last_finish as until_next, last_run_success, total_runs, total_successes, total_failures, total_crashes
|
SELECT job_id, time_bucket('1m',next_start) AS next_start, time_bucket('1m',last_finish) as until_next, last_run_success, total_runs, total_successes, total_failures, total_crashes
|
||||||
FROM _timescaledb_internal.bgw_job_stat
|
FROM _timescaledb_internal.bgw_job_stat
|
||||||
where job_id=:drop_chunks_job_id;
|
where job_id=:drop_chunks_job_id;
|
||||||
job_id | next_start | until_next | last_run_success | total_runs | total_successes | total_failures | total_crashes
|
job_id | next_start | until_next | last_run_success | total_runs | total_successes | total_failures | total_crashes
|
||||||
--------+------------------------------+------------------------------+------------------+------------+-----------------+----------------+---------------
|
--------+------------------------------+------------------------------+------------------+------------+-----------------+----------------+---------------
|
||||||
1001 | Fri Dec 31 16:00:02 1999 PST | Fri Dec 31 16:00:01 1999 PST | t | 2 | 2 | 0 | 0
|
1001 | Fri Dec 31 16:00:00 1999 PST | Fri Dec 31 16:00:00 1999 PST | t | 2 | 2 | 0 | 0
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT show_chunks('test_drop_chunks_table');
|
SELECT show_chunks('test_drop_chunks_table');
|
||||||
@ -660,12 +660,12 @@ SELECT * FROM _timescaledb_config.bgw_job where id=:drop_chunks_job_id;
|
|||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- should now have a failure
|
-- should now have a failure
|
||||||
SELECT job_id, next_start, last_finish as until_next, last_run_success, total_runs, total_successes, total_failures, total_crashes
|
SELECT job_id, time_bucket('1m',next_start) AS next_start, time_bucket('1m',last_finish) as until_next, last_run_success, total_runs, total_successes, total_failures, total_crashes
|
||||||
FROM _timescaledb_internal.bgw_job_stat
|
FROM _timescaledb_internal.bgw_job_stat
|
||||||
where job_id=:drop_chunks_job_id;
|
where job_id=:drop_chunks_job_id;
|
||||||
job_id | next_start | until_next | last_run_success | total_runs | total_successes | total_failures | total_crashes
|
job_id | next_start | until_next | last_run_success | total_runs | total_successes | total_failures | total_crashes
|
||||||
--------+-------------------------------------+---------------------------------+------------------+------------+-----------------+----------------+---------------
|
--------+------------------------------+------------------------------+------------------+------------+-----------------+----------------+---------------
|
||||||
1001 | Fri Dec 31 16:00:14.971875 1999 PST | Fri Dec 31 16:00:10.05 1999 PST | f | 3 | 2 | 1 | 0
|
1001 | Fri Dec 31 16:00:00 1999 PST | Fri Dec 31 16:00:00 1999 PST | f | 3 | 2 | 1 | 0
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
SELECT show_chunks('test_drop_chunks_table');
|
SELECT show_chunks('test_drop_chunks_table');
|
||||||
|
@ -245,7 +245,7 @@ SELECT * FROM sorted_bgw_log;
|
|||||||
SELECT * FROM _timescaledb_config.bgw_job where id=:drop_chunks_job_id;
|
SELECT * FROM _timescaledb_config.bgw_job where id=:drop_chunks_job_id;
|
||||||
|
|
||||||
-- job ran once, successfully
|
-- job ran once, successfully
|
||||||
SELECT job_id, next_start, last_finish as until_next, last_run_success, total_runs, total_successes, total_failures, total_crashes
|
SELECT job_id, time_bucket('1m',next_start) AS next_start, time_bucket('1m',last_finish) as until_next, last_run_success, total_runs, total_successes, total_failures, total_crashes
|
||||||
FROM _timescaledb_internal.bgw_job_stat
|
FROM _timescaledb_internal.bgw_job_stat
|
||||||
where job_id=:drop_chunks_job_id;
|
where job_id=:drop_chunks_job_id;
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ SELECT * FROM sorted_bgw_log;
|
|||||||
SELECT * FROM _timescaledb_config.bgw_job where id=:drop_chunks_job_id;
|
SELECT * FROM _timescaledb_config.bgw_job where id=:drop_chunks_job_id;
|
||||||
|
|
||||||
-- still only 1 run
|
-- still only 1 run
|
||||||
SELECT job_id, next_start, last_finish as until_next, last_run_success, total_runs, total_successes, total_failures, total_crashes
|
SELECT job_id, time_bucket('1m',next_start) AS next_start, time_bucket('1m',last_finish) as until_next, last_run_success, total_runs, total_successes, total_failures, total_crashes
|
||||||
FROM _timescaledb_internal.bgw_job_stat
|
FROM _timescaledb_internal.bgw_job_stat
|
||||||
where job_id=:drop_chunks_job_id;
|
where job_id=:drop_chunks_job_id;
|
||||||
|
|
||||||
@ -279,7 +279,7 @@ SELECT * FROM sorted_bgw_log;
|
|||||||
SELECT * FROM _timescaledb_config.bgw_job where id=:drop_chunks_job_id;
|
SELECT * FROM _timescaledb_config.bgw_job where id=:drop_chunks_job_id;
|
||||||
|
|
||||||
-- 2 runs
|
-- 2 runs
|
||||||
SELECT job_id, next_start, last_finish as until_next, last_run_success, total_runs, total_successes, total_failures, total_crashes
|
SELECT job_id, time_bucket('1m',next_start) AS next_start, time_bucket('1m',last_finish) as until_next, last_run_success, total_runs, total_successes, total_failures, total_crashes
|
||||||
FROM _timescaledb_internal.bgw_job_stat
|
FROM _timescaledb_internal.bgw_job_stat
|
||||||
where job_id=:drop_chunks_job_id;
|
where job_id=:drop_chunks_job_id;
|
||||||
|
|
||||||
@ -307,7 +307,7 @@ SELECT * FROM sorted_bgw_log;
|
|||||||
SELECT * FROM _timescaledb_config.bgw_job where id=:drop_chunks_job_id;
|
SELECT * FROM _timescaledb_config.bgw_job where id=:drop_chunks_job_id;
|
||||||
|
|
||||||
-- should now have a failure
|
-- should now have a failure
|
||||||
SELECT job_id, next_start, last_finish as until_next, last_run_success, total_runs, total_successes, total_failures, total_crashes
|
SELECT job_id, time_bucket('1m',next_start) AS next_start, time_bucket('1m',last_finish) as until_next, last_run_success, total_runs, total_successes, total_failures, total_crashes
|
||||||
FROM _timescaledb_internal.bgw_job_stat
|
FROM _timescaledb_internal.bgw_job_stat
|
||||||
where job_id=:drop_chunks_job_id;
|
where job_id=:drop_chunks_job_id;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user