Skip to content

Commit

Permalink
set timezone in test before dumping timestamp
Browse files Browse the repository at this point in the history
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
  • Loading branch information
michel-slm authored and facebook-github-bot committed May 17, 2024
1 parent e44c3dd commit 26ad245
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions below/dump/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 26ad245

Please sign in to comment.