From 88296cf8bcdbfc849817f1639dd41167a4ccd36f Mon Sep 17 00:00:00 2001 From: hengyunabc Date: Wed, 4 Nov 2020 00:51:45 +0800 Subject: [PATCH] fix travis-ci failed problem. --- .../taobao/arthas/boot/DownloadUtilsTest.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/boot/src/test/java/com/taobao/arthas/boot/DownloadUtilsTest.java b/boot/src/test/java/com/taobao/arthas/boot/DownloadUtilsTest.java index a681ef112..2b5f09c81 100644 --- a/boot/src/test/java/com/taobao/arthas/boot/DownloadUtilsTest.java +++ b/boot/src/test/java/com/taobao/arthas/boot/DownloadUtilsTest.java @@ -3,6 +3,8 @@ package com.taobao.arthas.boot; import java.io.File; import java.io.IOException; import java.util.List; +import java.util.TimeZone; +import java.util.concurrent.TimeUnit; import org.junit.Assert; import org.junit.Rule; @@ -29,13 +31,16 @@ public class DownloadUtilsTest { @Test public void testAliyunDownload() throws IOException { - String version = "3.3.7"; - File folder = rootFolder.newFolder(); - System.err.println(folder.getAbsolutePath()); - DownloadUtils.downArthasPackaging("aliyun", false, version, folder.getAbsolutePath()); + // fix travis-ci failed problem + if (TimeUnit.MILLISECONDS.toHours(TimeZone.getDefault().getOffset(System.currentTimeMillis())) == 8) { + String version = "3.3.7"; + File folder = rootFolder.newFolder(); + System.err.println(folder.getAbsolutePath()); + DownloadUtils.downArthasPackaging("aliyun", false, version, folder.getAbsolutePath()); - File as = new File(folder, version + File.separator + "arthas" + File.separator + "as.sh"); - Assert.assertTrue(as.exists()); + File as = new File(folder, version + File.separator + "arthas" + File.separator + "as.sh"); + Assert.assertTrue(as.exists()); + } } @Test