Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve winlogbeat checkpoint test #4371

Merged

Conversation

Projects
None yet
2 participants
@andrewkroh
Copy link
Member

commented May 22, 2017

  • Check for errors and exit to stop panics from occurring when the test fails.
  • Increase the sleep to 750ms to give the checkpoint more time to flush states to disk.
Improve winlogbeat checkpoint test
Check for errors and exit to stop panics from occurring when the test fails.
Increase the sleep to 750ms to give the checkpoint more time to flush states to disk.
@ruflin

ruflin approved these changes May 22, 2017

Copy link
Collaborator

left a comment

WFG

@ruflin ruflin merged commit 5b7ce03 into elastic:master May 22, 2017

5 checks passed

CLA Commit author has signed the CLA
Details
codecov/patch Coverage not affected when comparing e66e185...483b20b
Details
codecov/project 63.21% (+0.11%) compared to e66e185
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

andrewkroh added a commit to andrewkroh/beats that referenced this pull request May 26, 2017

Improve winlogbeat checkpoint test (elastic#4371)
Check for errors and exit to stop panics from occurring when the test fails.
Increase the sleep to 750ms to give the checkpoint more time to flush states to disk.

andrewkroh added a commit to andrewkroh/beats that referenced this pull request May 26, 2017

Improve winlogbeat checkpoint test (elastic#4371)
Check for errors and exit to stop panics from occurring when the test fails.
Increase the sleep to 750ms to give the checkpoint more time to flush states to disk.

tsg added a commit that referenced this pull request Jun 2, 2017

Cherry-pick various test fixes to 5.4 (#4404)
* Ignore permission errors in Metricbeat’s TestFileSystemList (#3562)

The test can fail if some calls to statfs fail due to permission errors. For example:

`stat("/var/lib/docker/aufs/mnt/50d0d5f599f0f19450e7649f73a0e23da1f172048e555df2b1cb78b3fefa355b", 0x7ffd2e5b8ed0) = -1 EACCES (Permission denied)`

* Less strict error matching in Winlogbeat config_test

Error string testing is brittle. The PR makes the test less stringent by not checking the full error message that includes the Golang stdlib error.

* Miscellaneous test fixes

- Fix and enable the python smoke test for heartbeat
- Remove fmt.Printf from metricbeat ceph module
- Fix Windows path issues in libbeat/paths tests
- Fix ioutil.TempDir usage in Packetbeat tests (it broke windows)

* Using single quotes around Windows paths

The thrift test config used double quotes around Windows path separators and this was interpreted incorrectly in YAML parsing.

* Rename TestBadCondition to TestConditions

This test doesn’t actually test any bad conditions. Plus there is another test in the same directory with the name TestBadCondition.

* Use logp.Beta or logp.Experimental in metricsets

And in system tests, centralize the logic for asserting that there are no ERR or WARN in logs.

Filter out errors about “The service process could not connect to the service controller” that occur when testing on Jenkins where Jenkins itself is running as a service. This confuses the Beat because it thinks that it is running as service, but it’s not.

* Remove OS specific error message check from mockbeat

The error message “no such file or directory” is an OS specific error message. There is a different error message on Windows. Simply checking for “error loading config file” should be sufficient.

* Use shorter filename in Filebeat test for Windows

The test was failing on Windows when `os.rename` failed with `[Error 3] The system cannot find the path specified`. The root cause of the failure was that the path was ~260 characters on Jenkins which is greater than the `MAX_PATH` value in Windows. This PR shortens the test log’s name to resolve the issue.

The other changes to normalize the filepath are nice to have for Windows, but not strictly required.

* Add filesystem name to test error message

Errors that are logged by the system/filesystem test case don’t have enough context to debug them. This adds the filesystem that caused the error to the message.

* Clean geoip.paths before using the path (#4306)

Use filepath.Clean on the configured paths to fix any invalid OS path separators.

Skip the geoip test with symlinks on Windows (`os.symlink` isn’t supported on Windows).

* Improve winlogbeat checkpoint test (#4371)

Check for errors and exit to stop panics from occurring when the test fails.
Increase the sleep to 750ms to give the checkpoint more time to flush states to disk.

* Fix Winlogbeat test by checking full hostname (#3942)

The `computer_name` field in events is the full hostname, but the `win32api.GetComputerName` was returning the shortened netbios name. So the test fail on machines with longer hostnames.

* Shorten test name to shorten path for windows (#4360)

On our CI system we get the following error:
```
WindowsError: [Error 206] The filename or extension is too long: 'C:\\Users\\jenkins\\workspace\\elastic+beats+pull-request+multijob-windows\\beat\\filebeat\\label\\windows\\src\\github.com\\elastic\\beats\\filebeat\\build\\system-tests\\run\\test_prospector.Test.test_close_inactive_file_rotation_and_removal_while_new_file_created'
```

The problem is that this path is 267 characters long. According to https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx the MAX_PATH length is 260. In general it seems we could hit this limitation also in lots of other ways where we cannot just reduce the length of the test name. There seems to be some possibility to increase this limit:

  To specify an extended-length path, use the "\\?\" prefix. For example, "\\?\D:\very long path".

We should test if this could also solve the problem as it raises the limit to 32767.

* Filter relative mounts in system filesystem metricset (#4370)

Add filtering to system filesystem metricset to remove relative mountpoints like those from Linux network namespaces.

@andrewkroh andrewkroh deleted the andrewkroh:feature/enhance-wlb-chechpoint-test branch Jul 5, 2017

ramon-garcia added a commit to ramon-garcia/beats that referenced this pull request Dec 5, 2017

Improve winlogbeat checkpoint test (elastic#4371)
Check for errors and exit to stop panics from occurring when the test fails.
Increase the sleep to 750ms to give the checkpoint more time to flush states to disk.

athom added a commit to athom/beats that referenced this pull request Jan 25, 2018

Improve winlogbeat checkpoint test (elastic#4371)
Check for errors and exit to stop panics from occurring when the test fails.
Increase the sleep to 750ms to give the checkpoint more time to flush states to disk.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.