2016-06-29

Jenkins時間同步導致的建構失敗

在某專案於Jenkins建置時,被視為建構失敗。
在看了Console Output之後,確認了兩件事:
1.專案編譯是成功的。
2.NUnit的測試也都Pass。

但在最後,Jenkins留下了錯誤原因:
Recording NUnit tests results
ERROR: Step ‘Publish NUnit test result report’ failed: Clock on this slave is out of sync with the master, and therefore I can't figure out what test results are new and what are old.
Please keep the slave clock in sync with the master.
Sending e-mails to: ....
Finished: FAILURE
從文中看到的意思,應該是因為Master和Slave Node之間的時間不同步(或差距太遠),導致分不出測試結果的新舊。

知道原因之後,到國家時間與頻率標準實驗室網站去下載校時軟體,讓Master和Slave都自動校時,以便兩者時間一致就行了,校時之後,重新建置就沒問題了!

註:
因為我的Master和Slave都是Windows Server作業系統,似乎找不到像一般Windows系統的「網際網路時間」的設定,以便自動同步NTP Server;要不就得改Registry,故先用校時軟體便宜行事了。


【延伸閱讀】
如何調整 Windows 作業系統的時間正確性 ( 終極指令版 )

沒有留言:

張貼留言

引用 Topshelf 無法進行偵錯的經驗

Topshelf  是一個可以簡化撰寫 Windows Service 的套件,引用之後,我們只要當作撰寫一般 Console 的應用程式就可以。 只是近來撰寫上遇到無法進行Debug的狀況,在Visual Studio一進行偵錯可以看到Console 程式被執行,並顯示...