fix the register test

This commit is contained in:
Tamo 2022-09-15 12:40:10 +02:00 committed by Clément Renault
parent 5436b996ab
commit a8b18b2c96
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -484,10 +484,11 @@ mod tests {
let rtxn = index_scheduler.env.read_txn().unwrap(); let rtxn = index_scheduler.env.read_txn().unwrap();
let mut all_tasks = Vec::new(); let mut all_tasks = Vec::new();
for ret in index_scheduler.all_tasks.iter(&rtxn).unwrap() { for ret in index_scheduler.all_tasks.iter(&rtxn).unwrap() {
all_tasks.push(ret.unwrap()); all_tasks.push(ret.unwrap().0);
} }
assert_smol_debug_snapshot!(all_tasks, @r###"[(U32(0), Task { uid: 0, enqueued_at: OffsetDateTime { local_datetime: PrimitiveDateTime { date: Date { year: 2022, ordinal: 258 }, time: Time { hour: 10, minute: 29, second: 58, nanosecond: 423000426 } }, offset: UtcOffset { hours: 0, minutes: 0, seconds: 0 } }, started_at: None, finished_at: None, error: None, details: None, status: Enqueued, kind: IndexCreation { index_uid: "catto", primary_key: Some("mouse") } }), (U32(1), Task { uid: 1, enqueued_at: OffsetDateTime { local_datetime: PrimitiveDateTime { date: Date { year: 2022, ordinal: 258 }, time: Time { hour: 10, minute: 29, second: 58, nanosecond: 423082546 } }, offset: UtcOffset { hours: 0, minutes: 0, seconds: 0 } }, started_at: None, finished_at: None, error: None, details: None, status: Enqueued, kind: DocumentAddition { index_uid: "catto", primary_key: None, content_file: b1d69015-c24b-446b-a736-d69ce2178279, documents_count: 12, allow_index_creation: true } }), (U32(2), Task { uid: 2, enqueued_at: OffsetDateTime { local_datetime: PrimitiveDateTime { date: Date { year: 2022, ordinal: 258 }, time: Time { hour: 10, minute: 29, second: 58, nanosecond: 423117327 } }, offset: UtcOffset { hours: 0, minutes: 0, seconds: 0 } }, started_at: None, finished_at: None, error: None, details: None, status: Enqueued, kind: CancelTask { tasks: [0, 1] } }), (U32(3), Task { uid: 3, enqueued_at: OffsetDateTime { local_datetime: PrimitiveDateTime { date: Date { year: 2022, ordinal: 258 }, time: Time { hour: 10, minute: 29, second: 58, nanosecond: 423146917 } }, offset: UtcOffset { hours: 0, minutes: 0, seconds: 0 } }, started_at: None, finished_at: None, error: None, details: None, status: Enqueued, kind: DocumentAddition { index_uid: "catto", primary_key: None, content_file: ff0a9258-88c5-4517-9f31-2a9bda25f8fb, documents_count: 50, allow_index_creation: true } }), (U32(4), Task { uid: 4, enqueued_at: OffsetDateTime { local_datetime: PrimitiveDateTime { date: Date { year: 2022, ordinal: 258 }, time: Time { hour: 10, minute: 29, second: 58, nanosecond: 423174667 } }, offset: UtcOffset { hours: 0, minutes: 0, seconds: 0 } }, started_at: None, finished_at: None, error: None, details: None, status: Enqueued, kind: DocumentAddition { index_uid: "doggo", primary_key: Some("bone"), content_file: 3eaff0f8-42f2-4d35-bf01-f47623dbd932, documents_count: 5000, allow_index_creation: true } })]"###); // we can't assert on the content of the tasks because there is the date and uuid that changes everytime.
assert_smol_debug_snapshot!(all_tasks, @"[U32(0), U32(1), U32(2), U32(3), U32(4)]");
let mut status = Vec::new(); let mut status = Vec::new();
for ret in index_scheduler.status.iter(&rtxn).unwrap() { for ret in index_scheduler.status.iter(&rtxn).unwrap() {