Centos
Xvfb 或 Firefox 拋出錯誤並無償記錄
根據這個問題的答案,我正在執行 Xvfb 來製作虛擬顯示,因此 firefox 將在我的 CentOS 伺服器上執行。(我不需要查看 firefox 或使用 firefox 執行任何實際的鍵或螢幕輸入/輸出——它只需要執行以便 Selenium 可以驅動它。)我試圖弄清楚為什麼 Xvfb(或 firefox)正在拋出一堆錯誤。
我用這個命令啟動 Xvfb:
Xvfb :1 -screen 0 1024x768x24 &
在我啟動它之後,幾條錯誤消息立即回顯到螢幕上(奇怪的是,它們出現在 shell 提示符之後):
[root@host /home/lm/cron]# Xvfb :1 -screen 0 1024x768x24 & [1] 9214 [root@host /home/lm/cron]# expected keysym, got XF86TouchpadOn: line 120 of inet expected keysym, got XF86TouchpadOff: line 121 of inet
當我執行我的 Selenium 測試腳本時,Selenium 日誌中會顯示更多錯誤:
5 XSELINUXs still allocated at reset SCREEN: 0 objects of 176 bytes = 0 total bytes 0 private allocs DEVICE: 4 objects of 48 bytes = 192 total bytes 0 private allocs CLIENT: 0 objects of 144 bytes = 0 total bytes 0 private allocs WINDOW: 0 objects of 48 bytes = 0 total bytes 0 private allocs PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs GC: 0 objects of 56 bytes = 0 total bytes 0 private allocs CURSOR: 0 objects of 8 bytes = 0 total bytes 0 private allocs CURSOR_BITS: 0 objects of 8 bytes = 0 total bytes 0 private allocs DBE_WINDOW: 0 objects of 24 bytes = 0 total bytes 0 private allocs TOTAL: 5 objects, 208 bytes, 0 allocs 4 DEVICEs still allocated at reset DEVICE: 4 objects of 48 bytes = 192 total bytes 0 private allocs CLIENT: 0 objects of 144 bytes = 0 total bytes 0 private allocs WINDOW: 0 objects of 48 bytes = 0 total bytes 0 private allocs PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs GC: 0 objects of 56 bytes = 0 total bytes 0 private allocs CURSOR: 0 objects of 8 bytes = 0 total bytes 0 private allocs CURSOR_BITS: 0 objects of 8 bytes = 0 total bytes 0 private allocs DBE_WINDOW: 0 objects of 24 bytes = 0 total bytes 0 private allocs TOTAL: 5 objects, 208 bytes, 0 allocs 1 PIXMAPs still allocated at reset PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs GC: 0 objects of 56 bytes = 0 total bytes 0 private allocs CURSOR: 0 objects of 8 bytes = 0 total bytes 0 private allocs CURSOR_BITS: 0 objects of 8 bytes = 0 total bytes 0 private allocs DBE_WINDOW: 0 objects of 24 bytes = 0 total bytes 0 private allocs TOTAL: 1 objects, 16 bytes, 0 allocs 14:33:47.919 INFO - Done: /session/1330284794945 expected keysym, got XF86TouchpadOn: line 120 of inet expected keysym, got XF86TouchpadOff: line 121 of inet
現在,這是有趣的部分,儘管所有這些混亂,一切都在工作:Selenium 正在與 firefox 屬性對話,firefox 正在做它應該做的事情並將其傳遞回 Selenium,等等。我只想知道(a)我是否應該擔心所有這些消息/錯誤,以及(b)我該如何清理它?(實際上在我看來,其中大部分是關於“allocs”的某種冗長的日誌資訊——我想關閉它——然後那些“預期的鍵符”消息是被拋出的異常。)
我不認為他們是錯誤的。
只是 X 伺服器很健談。
您也可以通過使用啟動 Xvfb 將這些消息發送到 /dev/null
Xvfb :1 -screen 0 1024x768x24 2>/dev/null &