diff --git a/tests/api/test_instance.py b/tests/api/test_instance.py index 829fc10f94..db3f09bef5 100644 --- a/tests/api/test_instance.py +++ b/tests/api/test_instance.py @@ -348,7 +348,7 @@ def test_app_status( "tasks_healthy": 2, "tasks_staged": 0, "tasks_total": 4, - "create_timestamp": 1560515696, + "create_timestamp": 1560540896.0, "deploy_status": "Running", "unused_offers": mock_summarize_unused_offers.return_value, "dashboard_url": "https://paasta.party/ui/#/apps/%2Ffoo", @@ -394,7 +394,7 @@ def test_list_tasks( "id": "baz", "host": "host1", "port": 123, - "deployed_timestamp": 1560517200, + "deployed_timestamp": 1560542400.0, "is_healthy": True, } ] @@ -773,7 +773,7 @@ async def test_get_mesos_running_task_dict(self, mock_task): "cpu_shares": {"value": 2.1}, "cpu_used_seconds": {"value": 1.5}, "deployed_timestamp": 1560888500, - "duration_seconds": 7540, + "duration_seconds": 32740, "tail_lines": {}, } diff --git a/tests/api/tweens/test_request_logger.py b/tests/api/tweens/test_request_logger.py index afeac91aec..ea7ab23337 100644 --- a/tests/api/tweens/test_request_logger.py +++ b/tests/api/tweens/test_request_logger.py @@ -86,7 +86,7 @@ def test_request_logger_tween_factory_log(mock_clog, mock_factory): '{"additional_key": "additional_value", ' '"cluster": "a_cluster", ' '"hostname": "a_hostname", ' - '"human_timestamp": "2020-05-18T18:54:09", ' + '"human_timestamp": "2020-05-18T11:54:09", ' '"level": "ERROR", ' '"unix_timestamp": 1589828049.0}' ), diff --git a/tests/cli/test_cmds_status.py b/tests/cli/test_cmds_status.py index b1515639f5..b661cbd217 100644 --- a/tests/cli/test_cmds_status.py +++ b/tests/cli/test_cmds_status.py @@ -2395,13 +2395,13 @@ def test_output( expected_output += [ f" Pods:", f" Pod ID Host deployed to Deployed at what localtime Health", - f" app_1 fake_host1 2019-07-12T20:31 ({mock_naturaltime.return_value}) {PaastaColors.green('Healthy')}", - f" app_2 fake_host2 2019-07-12T20:31 ({mock_naturaltime.return_value}) {PaastaColors.green('Healthy')}", - f" app_3 fake_host3 2019-07-12T20:31 ({mock_naturaltime.return_value}) {PaastaColors.red('Evicted')}", + f" app_1 fake_host1 2019-07-12T13:31 ({mock_naturaltime.return_value}) {PaastaColors.green('Healthy')}", + f" app_2 fake_host2 2019-07-12T13:31 ({mock_naturaltime.return_value}) {PaastaColors.green('Healthy')}", + f" app_3 fake_host3 2019-07-12T13:31 ({mock_naturaltime.return_value}) {PaastaColors.red('Evicted')}", f" {PaastaColors.grey(' Disk quota exceeded')}", f" ReplicaSets:", f" ReplicaSet Name Ready / Desired Created at what localtime Service git SHA Config hash", - f" replicaset_1 {PaastaColors.red('2/3')} 2019-07-12T20:31 ({mock_naturaltime.return_value}) Unknown Unknown", + f" replicaset_1 {PaastaColors.red('2/3')} 2019-07-12T13:31 ({mock_naturaltime.return_value}) Unknown Unknown", ] assert expected_output == output @@ -3062,7 +3062,7 @@ def test_marathon_app_status_human(self, mock_naturaltime, mock_app_status): assert uncolored_output == [ f"Dashboard: {mock_app_status.dashboard_url}", f" 5 running, 4 healthy, 3 staged out of 12", - f" App created: 2019-08-13 21:28:01 ({mock_naturaltime.return_value})", + f" App created: 2019-08-13 14:28:01 ({mock_naturaltime.return_value})", f" Status: Deploying", ] @@ -3107,7 +3107,7 @@ def test_format_marathon_task_table(self, mock_naturaltime, mock_marathon_task): assert task_table_dict == { "Mesos Task ID": "abc123", "Host deployed to": "paasta.cloud:4321", - "Deployed at what localtime": f"2019-08-12T22:23 ({mock_naturaltime.return_value})", + "Deployed at what localtime": f"2019-08-12T15:23 ({mock_naturaltime.return_value})", "Health": PaastaColors.green("Healthy"), } @@ -3168,7 +3168,7 @@ def test_format_kubernetes_pod_table( assert pod_table_dict == { "Pod ID": "abc123", "Host deployed to": "paasta.cloud", - "Deployed at what localtime": f"2019-08-12T22:23 ({mock_naturaltime.return_value})", + "Deployed at what localtime": f"2019-08-12T15:23 ({mock_naturaltime.return_value})", "Health": PaastaColors.green("Healthy"), } @@ -3183,7 +3183,7 @@ def test_format_kubernetes_replicaset_table( assert replicaset_table_dict == { "ReplicaSet Name": "abc123", "Ready / Desired": PaastaColors.green("3/3"), - "Created at what localtime": f"2019-08-12T22:23 ({mock_naturaltime.return_value})", + "Created at what localtime": f"2019-08-12T15:23 ({mock_naturaltime.return_value})", "Service git SHA": "def456", "Config hash": "Unknown", } @@ -3326,7 +3326,7 @@ def test_create_mesos_running_tasks_table( "Host deployed to": mock_running_task.hostname, "Ram": "1/2MB", "CPU": "0.8%", - "Deployed at what localtime": f"2019-08-11T23:51 ({mock_naturaltime.return_value})", + "Deployed at what localtime": f"2019-08-11T16:51 ({mock_naturaltime.return_value})", } assert output[2:] == ["tail line 1", "tail line 2"] mock_format_tail_lines_for_mesos_task.assert_called_once_with( @@ -3391,7 +3391,7 @@ def test_create_mesos_non_running_tasks_table( assert task_dict == { "Mesos Task ID": mock_non_running_task.id, "Host deployed to": mock_non_running_task.hostname, - "Deployed at what localtime": f"2019-08-01T07:00 ({mock_naturaltime.return_value})", + "Deployed at what localtime": f"2019-08-01T00:00 ({mock_naturaltime.return_value})", "Status": mock_non_running_task.state, } assert uncolored_output[2:] == ["tail line 1", "tail line 2"] diff --git a/tests/test_mesos_maintenance.py b/tests/test_mesos_maintenance.py index e8e7f46111..8924cd0878 100644 --- a/tests/test_mesos_maintenance.py +++ b/tests/test_mesos_maintenance.py @@ -89,7 +89,7 @@ def test_parse_datetime_invalid(): def test_parse_datetime(): - assert parse_datetime("November 11, 2011 11:11:11Z") == 1321009871000000000 + assert parse_datetime("November 11, 2011 11:11:11Z") == 1321038671000000000 @mock.patch("paasta_tools.mesos_maintenance.now", autospec=True) @@ -109,7 +109,7 @@ def test_seconds_to_nanoseconds(): def test_datetime_to_nanoseconds(): dt = datetime.datetime(2016, 4, 16, 0, 23, 40, 157145, tzinfo=tz.tzutc()) - expected = 1460766220000000000 + expected = 1460795020000000000 assert datetime_to_nanoseconds(dt) == expected