Fixing the flaky tests by freezing the datetime for tests