[2020-10-30T13:59:13.706Z] C:\Users\jenkins\workspace\Beats_beats_PR-19803\src\github.com\elastic\beats\filebeat>mage build unitTest
[2020-10-30T13:59:26.626Z] >> build: Building filebeat
[2020-10-30T14:00:34.798Z] >> go test: Unit Testing
[2020-10-30T14:01:43.449Z] SUMMARY:
[2020-10-30T14:01:43.449Z] Fail: 0
[2020-10-30T14:01:43.449Z] Skip: 5
[2020-10-30T14:01:43.449Z] Pass: 631
[2020-10-30T14:01:43.449Z] Packages: 26
[2020-10-30T14:01:43.449Z] Duration: 1m5.6816407s
[2020-10-30T14:01:43.449Z] Coverage Report: C:\Users\jenkins\workspace\Beats_beats_PR-19803\src\github.com\elastic\beats\filebeat\build\TEST-go-unit.html
[2020-10-30T14:01:43.449Z] JUnit Report: C:\Users\jenkins\workspace\Beats_beats_PR-19803\src\github.com\elastic\beats\filebeat\build\TEST-go-unit.xml
[2020-10-30T14:01:43.449Z] Output File: C:\Users\jenkins\workspace\Beats_beats_PR-19803\src\github.com\elastic\beats\filebeat\build\TEST-go-unit.out
[2020-10-30T14:01:43.449Z] >> go test: Unit Test Passed
[2020-10-30T14:01:53.676Z] >> python test: Unit Testing
[2020-10-30T14:02:09.135Z] ERROR: Could not install packages due to an EnvironmentError: [WinError 5] Access is denied: 'C:\\Users\\jenkins\\AppData\\Local\\Temp\\pip-uninstall-gc041_7j\\pip.exe'
[2020-10-30T14:02:09.135Z] Consider using the `--user` option or check the permissions.
[2020-10-30T14:02:09.135Z]
[2020-10-30T14:02:41.384Z] warn: failed to upgrade pip (ignoring): running "null\build\ve\windows\Scripts\pip install -U pip" failed with exit code 1============================= test session starts =============================
[2020-10-30T14:02:41.384Z] platform win32 -- Python 3.8.6, pytest-6.0.1, py-1.9.0, pluggy-0.13.1
[2020-10-30T14:02:41.384Z] rootdir: C:\Users\jenkins\workspace\Beats_beats_PR-19803\src\github.com\elastic\beats, configfile: pytest.ini
[2020-10-30T14:02:41.384Z] plugins: rerunfailures-9.0, timeout-1.3.4
[2020-10-30T14:02:41.384Z] timeout: 90.0s
[2020-10-30T14:02:41.384Z] timeout method: thread
[2020-10-30T14:02:41.384Z] timeout func_only: True
[2020-10-30T14:02:41.384Z] collected 321 items
[2020-10-30T14:02:41.384Z]
[2020-10-30T14:02:41.384Z] tests\system\test_autodiscover.py ss [ 0%]
[2020-10-30T14:02:43.639Z] tests\system\test_base.py ......ss [ 3%]
[2020-10-30T14:02:45.812Z] tests\system\test_cmd.py ... [ 4%]
[2020-10-30T14:02:47.059Z] tests\system\test_container.py .. [ 4%]
[2020-10-30T14:03:08.282Z] tests\system\test_crawler.py ......s.......... [ 9%]
[2020-10-30T14:03:08.854Z] tests\system\test_deprecated.py .. [ 10%]
[2020-10-30T14:03:11.154Z] tests\system\test_fields.py .... [ 11%]
[2020-10-30T14:03:13.081Z] tests\system\test_generate.py ... [ 12%]
[2020-10-30T14:03:38.076Z] tests\system\test_harvester.py ................F.... [ 19%]
[2020-10-30T14:03:39.109Z] tests\system\test_index_pattern.py .. [ 19%]
[2020-10-30T14:04:04.696Z] tests\system\test_input.py .........ss........... [ 26%]
[2020-10-30T14:04:10.888Z] tests\system\test_json.py .............. [ 31%]
[2020-10-30T14:04:11.820Z] tests\system\test_keystore.py .. [ 31%]
[2020-10-30T14:04:11.820Z] tests\system\test_load.py sss [ 32%]
[2020-10-30T14:04:12.078Z] tests\system\test_modules.py sssssssssssssssssssssssssssssssssssssssssss [ 46%]
[2020-10-30T14:04:12.336Z] ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 68%]
[2020-10-30T14:04:12.336Z] sssssss [ 70%]
[2020-10-30T14:04:27.555Z] tests\system\test_multiline.py ......... [ 73%]
[2020-10-30T14:04:27.555Z] tests\system\test_pipeline.py s [ 73%]
[2020-10-30T14:04:33.636Z] tests\system\test_processors.py ............. [ 77%]
[2020-10-30T14:04:33.898Z] tests\system\test_publisher.py . [ 78%]
[2020-10-30T14:04:33.898Z] tests\system\test_redis.py s [ 78%]
[2020-10-30T14:05:00.935Z] tests\system\test_registrar.py sss........ssss......ss.. [ 86%]
[2020-10-30T14:05:00.935Z] tests\system\test_registrar_upgrade.py sssss [ 87%]
[2020-10-30T14:05:22.468Z] tests\system\test_reload_inputs.py ....... [ 90%]
[2020-10-30T14:05:31.083Z] tests\system\test_reload_modules.py ...s.. [ 91%]
[2020-10-30T14:05:31.083Z] tests\system\test_setup.py s [ 92%]
[2020-10-30T14:05:41.370Z] tests\system\test_shutdown.py ..s.. [ 93%]
[2020-10-30T14:05:42.529Z] tests\system\test_stdin.py ... [ 94%]
[2020-10-30T14:05:44.223Z] tests\system\test_syslog.py ...ss [ 96%]
[2020-10-30T14:05:46.005Z] tests\system\test_tcp.py ... [ 97%]
[2020-10-30T14:05:48.231Z] tests\system\test_tcp_tls.py ..... [ 98%]
[2020-10-30T14:05:48.488Z] tests\system\test_udp.py . [ 99%]
[2020-10-30T14:05:48.488Z] tests\system\test_unix.py sss [100%]
[2020-10-30T14:05:48.488Z]
[2020-10-30T14:05:48.488Z] ================================== FAILURES ===================================
[2020-10-30T14:05:48.488Z] __________________________ Test.test_symlink_rotated __________________________
[2020-10-30T14:05:48.488Z]
[2020-10-30T14:05:48.488Z] self = <test_harvester.Test testMethod=test_symlink_rotated>
[2020-10-30T14:05:48.488Z]
[2020-10-30T14:05:48.488Z] def test_symlink_rotated(self):
[2020-10-30T14:05:48.488Z] """
[2020-10-30T14:05:48.488Z] Test what happens if symlink removed and points to a new file
[2020-10-30T14:05:48.488Z] """
[2020-10-30T14:05:48.488Z] self.render_config_template(
[2020-10-30T14:05:48.488Z] path=os.path.abspath(self.working_dir) + "/log/symlink.log",
[2020-10-30T14:05:48.488Z] symlinks="true",
[2020-10-30T14:05:48.488Z] close_removed="false",
[2020-10-30T14:05:48.488Z] clean_removed="false",
[2020-10-30T14:05:48.488Z] )
[2020-10-30T14:05:48.488Z]
[2020-10-30T14:05:48.488Z] os.mkdir(self.working_dir + "/log/")
[2020-10-30T14:05:48.488Z]
[2020-10-30T14:05:48.489Z] logfile1 = self.working_dir + "/log/test1.log"
[2020-10-30T14:05:48.489Z] logfile2 = self.working_dir + "/log/test2.log"
[2020-10-30T14:05:48.489Z] symlink = self.working_dir + "/log/symlink.log"
[2020-10-30T14:05:48.489Z]
[2020-10-30T14:05:48.489Z] if os.name == "nt":
[2020-10-30T14:05:48.489Z] import win32file
[2020-10-30T14:05:48.489Z] win32file.CreateSymbolicLink(symlink, logfile1, 0)
[2020-10-30T14:05:48.489Z] else:
[2020-10-30T14:05:48.489Z] os.symlink(logfile1, symlink)
[2020-10-30T14:05:48.489Z]
[2020-10-30T14:05:48.489Z] with open(logfile1, 'a') as file:
[2020-10-30T14:05:48.489Z] file.write("Hello World1\n")
[2020-10-30T14:05:48.489Z]
[2020-10-30T14:05:48.489Z] with open(logfile2, 'a') as file:
[2020-10-30T14:05:48.489Z] file.write("Hello World2\n")
[2020-10-30T14:05:48.489Z]
[2020-10-30T14:05:48.489Z] filebeat = self.start_beat()
[2020-10-30T14:05:48.489Z]
[2020-10-30T14:05:48.489Z] # Make sure some state is written
[2020-10-30T14:05:48.489Z] self.wait_until(
[2020-10-30T14:05:48.489Z] lambda: len(self.get_registry()) > 0,
[2020-10-30T14:05:48.489Z] max_timeout=10)
[2020-10-30T14:05:48.489Z]
[2020-10-30T14:05:48.489Z] # Make sure symlink is skipped
[2020-10-30T14:05:48.489Z] self.wait_until(
[2020-10-30T14:05:48.489Z] lambda: self.output_has(lines=1),
[2020-10-30T14:05:48.489Z] max_timeout=10)
[2020-10-30T14:05:48.489Z]
[2020-10-30T14:05:48.489Z] os.remove(symlink)
[2020-10-30T14:05:48.489Z]
[2020-10-30T14:05:48.489Z] if os.name == "nt":
[2020-10-30T14:05:48.489Z] import win32file
[2020-10-30T14:05:48.489Z] > win32file.CreateSymbolicLink(symlink, logfile2, 0)
[2020-10-30T14:05:48.489Z] E pywintypes.error: (5, 'CreateSymbolicLink', 'Access is denied.')
[2020-10-30T14:05:48.489Z]
[2020-10-30T14:05:48.489Z] tests\system\test_harvester.py:611: error
[2020-10-30T14:05:48.489Z] - generated xml file: C:\Users\jenkins\workspace\Beats_beats_PR-19803\src\github.com\elastic\beats\filebeat\build\TEST-python-unit.xml -
[2020-10-30T14:05:48.489Z] ============================ slowest 20 durations =============================
[2020-10-30T14:05:48.489Z] 11.35s call filebeat/tests/system/test_harvester.py::Test::test_close_timeout
[2020-10-30T14:05:48.489Z] 6.03s call filebeat/tests/system/test_registrar.py::Test::test_restart_state
[2020-10-30T14:05:48.489Z] 4.81s call filebeat/tests/system/test_shutdown.py::Test::test_shutdown_wait_timeout
[2020-10-30T14:05:48.489Z] 4.43s call filebeat/tests/system/test_input.py::Test::test_harvester_limit
[2020-10-30T14:05:48.489Z] 4.42s call filebeat/tests/system/test_reload_inputs.py::Test::test_reload_add
[2020-10-30T14:05:48.489Z] 4.31s call filebeat/tests/system/test_crawler.py::Test::test_encodings
[2020-10-30T14:05:48.489Z] 4.20s call filebeat/tests/system/test_crawler.py::Test::test_multiple_appends
[2020-10-30T14:05:48.489Z] 3.72s call filebeat/tests/system/test_input.py::Test::test_rotating_close_inactive_low_write_rate
[2020-10-30T14:05:48.489Z] 3.65s call filebeat/tests/system/test_input.py::Test::test_close_inactive_file_rotation_and_removal2
[2020-10-30T14:05:48.489Z] 3.53s call filebeat/tests/system/test_multiline.py::Test::test_close_timeout_with_multiline
[2020-10-30T14:05:48.489Z] 3.45s call filebeat/tests/system/test_reload_inputs.py::Test::test_start_stop_replace
[2020-10-30T14:05:48.489Z] 3.44s call filebeat/tests/system/test_reload_inputs.py::Test::test_reload_same_input
[2020-10-30T14:05:48.489Z] 3.44s call filebeat/tests/system/test_reload_inputs.py::Test::test_reload_same_config
[2020-10-30T14:05:48.489Z] 3.34s call filebeat/tests/system/test_reload_modules.py::Test::test_start_stop
[2020-10-30T14:05:48.489Z] 3.33s call filebeat/tests/system/test_reload_inputs.py::Test::test_start_stop
[2020-10-30T14:05:48.489Z] 3.33s call filebeat/tests/system/test_registrar.py::Test::test_state_after_rotation_ignore_older
[2020-10-30T14:05:48.489Z] 3.32s call filebeat/tests/system/test_registrar.py::Test::test_state_after_rotation
[2020-10-30T14:05:48.489Z] 3.16s call filebeat/tests/system/test_shutdown.py::Test::test_shutdown
[2020-10-30T14:05:48.489Z] 2.54s call filebeat/tests/system/test_multiline.py::Test::test_timeout
[2020-10-30T14:05:48.489Z] 2.35s call filebeat/tests/system/test_registrar.py::Test::test_ignore_older_state_clean_inactive
[2020-10-30T14:05:48.489Z] =========================== short test summary info ===========================
[2020-10-30T14:05:48.489Z] FAILED tests\system\test_harvester.py::Test::test_symlink_rotated - pywintype...
[2020-10-30T14:05:48.489Z] =========== 1 failed, 164 passed, 156 skipped in 191.52s (0:03:11) ============
[2020-10-30T14:05:48.750Z] >> python test: Unit Testing Complete
[2020-10-30T14:05:48.750Z] Error: running "null\build\ve\windows\Scripts\pytest.exe --timeout=90 --durations=20 --junit-xml=build/TEST-python-unit.xml tests\system\test_autodiscover.py tests\system\test_base.py tests\system\test_cmd.py tests\system\test_container.py tests\system\test_crawler.py tests\system\test_deprecated.py tests\system\test_fields.py tests\system\test_generate.py tests\system\test_harvester.py tests\system\test_index_pattern.py tests\system\test_input.py tests\system\test_json.py tests\system\test_keystore.py tests\system\test_load.py tests\system\test_modules.py tests\system\test_multiline.py tests\system\test_pipeline.py tests\system\test_processors.py tests\system\test_publisher.py tests\system\test_redis.py tests\system\test_registrar.py tests\system\test_registrar_upgrade.py tests\system\test_reload_inputs.py tests\system\test_reload_modules.py tests\system\test_setup.py tests\system\test_shutdown.py tests\system\test_stdin.py tests\system\test_syslog.py tests\system\test_tcp.py tests\system\test_tcp_tls.py tests\system\test_udp.py tests\system\test_unix.py" failed with exit code 1
script returned exit code 1[2020-10-30T14:05:49.116Z]
Failed Test
test_symlink_rotated – filebeat.tests.system.test_harvester.Testbeats/filebeat/tests/system/test_harvester.py
Line 566 in f23f05a
Stacktrace