summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichel Lind <michel@meta.com>2024-05-17 08:29:54 -0700
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>2024-05-17 08:29:54 -0700
commit26ad245a7249c5d91a3d43aeea732a98a79dd8b1 (patch)
treec92379c3f59b56db1236299de84bcd1221e26d88
parente44c3ddc7d546d298ca57166aa0e770283509976 (diff)
set timezone in test before dumping timestamp
Summary: The tests that check the serialized result fail when they contain timestamps when run on any system that is not set to Pacific time (e.g. Fedora build systems are set to UTC). Set the timezone we expect explicitly for the tests Reviewed By: davide125 Differential Revision: D57490840 fbshipit-source-id: c65f2ee919772776c3436cd614877db77635f58b
-rw-r--r--below/dump/src/test.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/below/dump/src/test.rs b/below/dump/src/test.rs
index 17396c39..765e1f91 100644
--- a/below/dump/src/test.rs
+++ b/below/dump/src/test.rs
@@ -1004,6 +1004,10 @@ fn test_dump_queue_content() {
hostname: "h".to_string(),
};
+ // we are dumping timestamps assuming they are local time
+ // so the timezone needs to be set to the expected TZ
+ std::env::set_var("TZ", "US/Pacific");
+
let result = queue_dumper
.dump_model(&ctx, &model, &mut queue_content, &mut round, false)
.expect("Failed to dump queue model");