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

Add missing error check when installing agent in endpoint-security tests #3122

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

cmacknz
Copy link
Member

@cmacknz cmacknz commented Jul 25, 2023

Fixes panics that should have failed with an error. Noticed in this test run hiding the real error.

--- FAIL: TestInstallAndCLIUninstallWithEndpointSecurity (0.37s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xae37bc]

goroutine 84 [running]:
testing.tRunner.func1.2({0xc59640, 0x18d0b20})
	/usr/local/go/src/testing/testing.go:1526 +0x1c8
testing.tRunner.func1()
	/usr/local/go/src/testing/testing.go:1529 +0x364
panic({0xc59640, 0x18d0b20})
	/usr/local/go/src/runtime/panic.go:884 +0x1f4
github.com/elastic/elastic-agent/testing/integration.TestInstallAndCLIUninstallWithEndpointSecurity(0x400039e340)
	/home/ubuntu/agent/testing/integration/endpoint_security_test.go:82 +0x29c
testing.tRunner(0x400039e340, 0xe260e8)
	/usr/local/go/src/testing/testing.go:1576 +0x104
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:1629 +0x370

Fixes nil deference when policy response is nil.
@cmacknz cmacknz added the Team:Elastic-Agent Label for the Agent team label Jul 25, 2023
@cmacknz cmacknz self-assigned this Jul 25, 2023
@cmacknz cmacknz requested a review from a team as a code owner July 25, 2023 18:04
@elasticmachine
Copy link
Contributor

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

@mergify
Copy link
Contributor

mergify bot commented Jul 25, 2023

This pull request does not have a backport label. Could you fix it @cmacknz? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 8./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

Copy link
Contributor

@blakerouse blakerouse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-07-25T18:05:00.498+0000

  • Duration: 29 min 48 sec

Test stats 🧪

Test Results
Failed 0
Passed 6099
Skipped 27
Total 6126

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Contributor

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 98.718% (77/78) 👍
Files 68.657% (184/268) 👍
Classes 67.606% (336/497) 👍
Methods 54.222% (1053/1942) 👍
Lines 40.328% (12044/29865) 👎 -0.013
Conditionals 100.0% (0/0) 💚

@cmacknz
Copy link
Member Author

cmacknz commented Jul 25, 2023

The AMD64 error:

    endpoint_security_test.go:83: 
        	Error Trace:	/home/ubuntu/agent/testing/integration/endpoint_security_test.go:248
        	            				/home/ubuntu/agent/testing/integration/endpoint_security_test.go:83
        	Error:      	Received unexpected error:
        	            	http error response with code 404: {StatusCode:404 Error:Not Found Message:Saved object [epm-packages/endpoint] not found}
        	Test:       	TestInstallAndCLIUninstallWithEndpointSecurity

The ARM64 error:

    endpoint_security_test.go:83: 
        	Error Trace:	/home/ubuntu/agent/testing/integration/endpoint_security_test.go:248
        	            				/home/ubuntu/agent/testing/integration/endpoint_security_test.go:83
        	Error:      	Received unexpected error:
        	            	http error response with code 500: {StatusCode:500 Error:Internal Server Error Message:Error installing endpoint 8.9.0: runtime_exception
        	            		Caused by:
        	            			version_conflict_engine_exception: [data_frame_transform_state_and_stats-endpoint.metadata_current-default-8.9.0]: version conflict, document already exists (current version [1])
        	            		Root causes:
        	            			runtime_exception: Failed to persist transform statistics for transform [endpoint.metadata_current-default-8.9.0]}
        	Test:       	TestInstallAndCLIUninstallWithEndpointSecurity

@cmacknz
Copy link
Member Author

cmacknz commented Jul 25, 2023

buildkite test it

@cmacknz
Copy link
Member Author

cmacknz commented Jul 25, 2023

Created elastic/kibana#162639 for the test failures observed above.

@cmacknz cmacknz merged commit 679c4ab into elastic:main Jul 25, 2023
@cmacknz cmacknz deleted the add-missing-error-check-endpoint-test branch July 25, 2023 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants