elastic / elastic/beats

[Flaky test] winlogbeat/tests/testscript TestScripts/eventlog/query_ignore_older

Open
#49,188 3 comments 0 reactions 0 assignees View on GitHub
Team:Security-Service Integrations
Dominant language
Go
Stars
12.7k
Forks
5k
Avg merge
2d 1h
Merged PRs (30d)
370

Description

## Flaky Test

* **Test Name:** TestScripts/eventlog/query_ignore_older
* **Link:** https://github.com/elastic/beats/blob/main/winlogbeat/tests/testscript/testscript_test.go#L69
* **Branch:** main, https://github.com/AndersonQ/beats/tree/filippo.io/edwards25519
* **Artifact Link:** [beats-winlogbeat_build_26149_windows-winlogbeat-win-2019-unit-tests.log](https://github.com/user-attachments/files/25684990/beats-winlogbeat_build_26149_windows-winlogbeat-win-2019-unit-tests.log)

* **Notes:** It seems related to the migration from the python tests to Go

### Stack Trace

```
=== FAIL: winlogbeat/tests/testscript TestScripts/eventlog/query_ignore_older (32.28s)
testscript.go:584: work=$WORK
path=C:\Users\BUILDK~1\AppData\Local\Temp\testscript-main1122000139\bin;C:\Users\Buildkite\.go\go-1.24.13\bin;C:\Users\Buildkite\.go\go-1.24.13\bin;C:\Users\Buildkite\.go\go-1.24.13\packages\bin;C:\Users\Buildkite\mingw64\bin;C:\Program Files\Python-3.9.13\Scripts\;C:\Program Files\Python-3.9.13\;C:\buildkite-agent\bin;C:\Program Files\Git\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\GooGet;C:\Program Files\Google\Compute Engine\metadata_scripts;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\Program Files\PowerShell\7\;C:\Program Files\Google\Compute Engine\sysprep;C:\ProgramData\Chocolatey\bin;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI\;C:\Users\packer\AppData\Local\Microsoft\WindowsApps;C:\Users\buildkite\AppData\Local\Microsoft\WindowsApps;C:\buildkite-agent\bin
gotraceback=system
userprofile=/no-home
tmp=$WORK\.tmp
devnull=NUL
/=\
:=;
$=$
gocoverdir=C:\Users\BUILDK~1\AppData\Local\Temp\go-build3095477774\b1412\gocoverdir
systemroot=C:\Windows
exe=.exe
evtx_testdata=C:\buildkite-agent\builds\bk-agent-prod-gcp-1772444013508440475\elastic\beats-winlogbeat\winlogbeat\sys\wineventlog\testdata
provider=WinlogbeatTest_e37d0b
app_source=WinlogbeatApp_e37d0b
other_app_source=WinlogbeatOther_e37d0b
hostname=bk-agent-prod-gcp-1772444013508440475
user_sid=S-1-5-21-953497442-850618864-3468330568-1002
> [!windows] skip 'requires Windows'
# Write an event, sleep 2s so it becomes older than 2s, then write a fresh event. (32.267s)
> write-event '>=2 seconds old' --id=20
> sleep 2s
> write-event '~0 seconds old' --id=10
> wait-for-event-log 2
FAIL: testdata\eventlog\query_ignore_older.txtar:7: wait-for-event-log: timed out after 30s; got 1 events in "WinlogbeatTest_e37d0b", want 2
```

Contributor guide

Open the contributing guide

Research direction

Start with winlogbeat/tests/testscript/testscript_test.go#L69 and testdata/eventlog/query_ignore_older.txtar, then run the targeted TestScripts/eventlog/query_ignore_older test on Windows. Review the linked unit-test artifact and the test's event-writing and wait-for-event-log steps. Done means the test consistently observes both events and passes on the Windows test environment.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
operating-systems, testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.