elastic / elastic-agent

Elastic Agent - single, unified way to add monitoring for logs, metrics, and other types of data to a host.
Other
21 stars 144 forks source link

[Flaky Test]: TestEscapingSecretsInPolicy #6107

Open ycombinator opened 9 hours ago

ycombinator commented 9 hours ago

Failing test case

TestEscapingSecretsInPolicy

Error message

Fails with exit status 1

Build

https://buildkite.com/elastic/elastic-agent-extended-testing/builds/4715#01934ad4-6fa1-4a78-af82-a8964d45308b

OS

Windows

Stacktrace and notes

=== RUN   TestEscapingSecretsInPolicy
    escaping_secrets_in_policy_test.go:110: Creating enrollment API key...
    fixture_install.go:168: [test TestEscapingSecretsInPolicy] Inside fixture install function
    fixture_install.go:196: [test TestEscapingSecretsInPolicy] Inside fixture installNoPkgManager function
    fetcher.go:93: Using existing artifact elastic-agent-9.0.0-SNAPSHOT-windows-x86_64.zip
    fixture.go:288: Extracting artifact elastic-agent-9.0.0-SNAPSHOT-windows-x86_64.zip to C:\Users\windows\AppData\Local\Temp\TestEscapingSecretsInPolicy3112794317
    fixture.go:306: Completed extraction of artifact elastic-agent-9.0.0-SNAPSHOT-windows-x86_64.zip to C:\Users\windows\AppData\Local\Temp\TestEscapingSecretsInPolicy3112794317
    fixture.go:906: Components were not modified from the fetched artifact
    fixture.go:663: >> running binary with: [C:\Users\windows\AppData\Local\Temp\TestEscapingSecretsInPolicy3112794317\elastic-agent-9.0.0-SNAPSHOT-windows-x86_64\elastic-agent.exe install --force --non-interactive --url https://dbfa8b793a1947948fe0b40b54da8beb.fleet.us-west2.gcp.elastic-cloud.com:443 --enrollment-token TVJFaFNwTUJhRFZzWHhmM3BaSHg6dWV5dWtRX3dRbi02ejdzdDlJQ1hBZw==]
    escaping_secrets_in_policy_test.go:110: >>> Enroll succeeded. Output: Installing in non-interactive mode.

[    ] Copying install files  [0s] 

[  ==] Successfully copied files  [5s] 

[==  ] Installing service  [5s] 

[==  ] Installed service  [5s] 

[==  ] Starting Service  [5s] 

[  ==] Service Started  [5s] Elastic Agent successfully installed, starting enrollment.

[  ==] Enrolling Elastic Agent with Fleet  [5s] 

[  ==] Waiting For Enroll...  [5s] {"log.level":"info","@timestamp":"2024-11-20T15:12:40.815Z","log.origin":{"function":"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).enrollWithBackoff","file.name":"cmd/enroll_cmd.go","file.line":520},"message":"Starting enrollment to URL: https://dbfa8b793a1947948fe0b40b54da8beb.fleet.us-west2.gcp.elastic-cloud.com:443/","ecs.version":"1.6.0"}
        {"log.level":"info","@timestamp":"2024-11-20T15:12:47.866Z","log.origin":{"function":"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).daemonReloadWithBackoff","file.name":"cmd/enroll_cmd.go","file.line":483},"message":"Restarting agent daemon, attempt 0","ecs.version":"1.6.0"}
        {"log.level":"info","@timestamp":"2024-11-20T15:12:47.870Z","log.origin":{"function":"github.com/elastic/elastic-agent/internal/pkg/agent/cmd.(*enrollCmd).Execute","file.name":"cmd/enroll_cmd.go","file.line":301},"message":"Successfully triggered restart on running Elastic Agent.","ecs.version":"1.6.0"}
        Successfully enrolled the Elastic Agent.

[==  ] Enroll Completed  [13s] 

[==  ] Done  [13s] 

[==  ] Done  [13s] 
        Elastic Agent has been successfully installed.
    check.go:64: Agent fleet status: updating
    check.go:64: Agent fleet status: enrolling
    fixture.go:663: >> running binary with: [C:\Program Files\Elastic\Agent\elastic-agent.exe diagnostics -p]
    escaping_secrets_in_policy_test.go:113: diagnostic command completed with output 
        "Creating diagnostics archive, waiting for CPU profile...\n"
    escaping_secrets_in_policy_test.go:113: 
            Error Trace:    C:/Users/windows/agent/pkg/testing/fixture.go:788
                                        C:/Users/windows/agent/testing/integration/escaping_secrets_in_policy_test.go:113
            Error:          Received unexpected error:
                            exit status 1
            Test:           TestEscapingSecretsInPolicy
            Messages:       error running diagnostic command: exit status 1
    fixture_install.go:265: [test TestEscapingSecretsInPolicy] Inside fixture cleanup function
    fixture_install.go:281: collecting diagnostics; test failed
    fixture.go:663: >> running binary with: [C:\Program Files\Elastic\Agent\elastic-agent.exe diagnostics -f C:\Users\windows\agent\build\diagnostics\TestEscapingSecretsInPolicy-2024-11-20T15-14-16Z-diagnostics.zip]
    fixture.go:663: >> running binary with: [C:\Program Files\Elastic\Agent\elastic-agent.exe uninstall --force]
    fixture.go:1031: Dumping running processes in C:\Users\windows\agent\build\diagnostics\TestEscapingSecretsInPolicy-2024-11-20T15-14-16Z-ProcessDump-cleanup.json
    fixture.go:1282: Temporary directory "C:\\Users\\windows\\AppData\\Local\\Temp\\TestEscapingSecretsInPolicy3112794317" preserved for investigation/debugging
--- FAIL: TestEscapingSecretsInPolicy (126.77s)
elasticmachine commented 9 hours ago

Pinging @elastic/elastic-agent (Team:Elastic-Agent)