Skip to content

Commit

Permalink
delay 1 second
Browse files Browse the repository at this point in the history
Signed-off-by: Tarek <[email protected]>
  • Loading branch information
tareknaser committed Jun 12, 2024
1 parent a4bb4d3 commit 14d8270
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
13 changes: 0 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,6 @@ jobs:

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Check
run: cargo check

- name: Format
run: |
cargo fmt --all -- --check
cargo clippy --workspace --bins -- -D warnings
- name: Build Debug
run: cargo build --verbose

- name: Run tests
run: cargo test --verbose
Expand Down
5 changes: 4 additions & 1 deletion fs-storage/src/file_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ mod tests {
assert!(before_write < after_write);
}
use std::io::Write;
#[test]
/*
A debugging test for checking metadata timestamps
Expand All @@ -400,6 +399,7 @@ mod tests {
- get metadata timestamp
- check if the timestamp has been updated
*/
#[test]
fn test_file_metadata_timestamp() {
let temp_dir =
TempDir::new("tmp").expect("Failed to create temporary directory");
Expand All @@ -411,6 +411,9 @@ mod tests {
.modified()
.unwrap();

// 1 second sleep to ensure the timestamp is updated
std::thread::sleep(std::time::Duration::from_secs(1));

let mut file = fs::File::create(&storage_path).unwrap();
file.write_all(b"test").unwrap();
file.flush().unwrap();
Expand Down

0 comments on commit 14d8270

Please sign in to comment.