From 3ea3c34f71ce1bce134461d5cd05d7b4a75c4853 Mon Sep 17 00:00:00 2001 From: Yusuke Kuoka Date: Sun, 20 Aug 2023 20:26:19 +0900 Subject: [PATCH] Fix random tikv tests after ts_to_vs test to not fail anymore (#2472) --- lib/src/kvs/tests/timestamp_to_versionstamp.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/src/kvs/tests/timestamp_to_versionstamp.rs b/lib/src/kvs/tests/timestamp_to_versionstamp.rs index f43f6006..63a9a645 100644 --- a/lib/src/kvs/tests/timestamp_to_versionstamp.rs +++ b/lib/src/kvs/tests/timestamp_to_versionstamp.rs @@ -11,23 +11,31 @@ // We need to translate the timestamp to the versionstamp due to that; `now - 1h` to a key suffixed by the versionstamp. #[tokio::test] #[serial] -#[ignore] async fn timestamp_to_versionstamp() { // Create a new datastore let ds = new_ds(Uuid::parse_str("A905CA25-56ED-49FB-B759-696AEA87C342").unwrap()).await; // Give the current versionstamp a timestamp of 0 let mut tx = ds.transaction(true, false).await.unwrap(); tx.set_timestamp_for_versionstamp(0, "myns", "mydb", true).await.unwrap(); + tx.commit().await.unwrap(); + // Get the versionstamp for timestamp 0 + let mut tx = ds.transaction(true, false).await.unwrap(); let vs1 = tx.get_versionstamp_from_timestamp(0, "myns", "mydb", true).await.unwrap().unwrap(); tx.commit().await.unwrap(); // Give the current versionstamp a timestamp of 1 let mut tx = ds.transaction(true, false).await.unwrap(); tx.set_timestamp_for_versionstamp(1, "myns", "mydb", true).await.unwrap(); + tx.commit().await.unwrap(); + // Get the versionstamp for timestamp 1 + let mut tx = ds.transaction(true, false).await.unwrap(); let vs2 = tx.get_versionstamp_from_timestamp(1, "myns", "mydb", true).await.unwrap().unwrap(); tx.commit().await.unwrap(); // Give the current versionstamp a timestamp of 2 let mut tx = ds.transaction(true, false).await.unwrap(); tx.set_timestamp_for_versionstamp(2, "myns", "mydb", true).await.unwrap(); + tx.commit().await.unwrap(); + // Get the versionstamp for timestamp 2 + let mut tx = ds.transaction(true, false).await.unwrap(); let vs3 = tx.get_versionstamp_from_timestamp(2, "myns", "mydb", true).await.unwrap().unwrap(); tx.commit().await.unwrap(); assert!(vs1 < vs2);