Skip to content

Conversation

kruskall
Copy link
Member

@kruskall kruskall commented Aug 9, 2022

main_test was disabled after the global state for the logsapi
listener was removed.
The new approach is to choose a random port and pass the address
to the app.
Add a timeout to make sure tests don't hang.

Blocked by #249

Closes #249

main_test was disabled after the global state for the logsapi
listener was removed.
The new approach is to choose a random port and pass the address
to the app.
Add a timeout to make sure tests don't hang.
@kruskall kruskall marked this pull request as draft August 9, 2022 17:52
@github-actions github-actions bot added the aws-λ-extension AWS Lambda Extension label Aug 9, 2022
@ghost
Copy link

ghost commented Aug 9, 2022

💚 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: 2022-08-22T11:12:51.532+0000

  • Duration: 7 min 18 sec

Test stats 🧪

Test Results
Failed 0
Passed 160
Skipped 2
Total 162

🤖 GitHub comments

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

  • /test : Re-trigger the build.

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

@kruskall kruskall marked this pull request as ready for review August 10, 2022 02:51
@kruskall
Copy link
Member Author

/test

Copy link
Member

@axw axw left a comment

Choose a reason for hiding this comment

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

Looks great!

Comment on lines +785 to +788
// we cannot return a port that is already in use or it
// would return an error when creating the server.
// The solution is to spawn a test server to get a random
// port and immediately close it so that we can use the port.
Copy link
Member

Choose a reason for hiding this comment

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

This is racy though, as another process could also be trying to acquire an ephemeral port. If the test ends up being flaky, we may need to have the extension listen on an ephemeral port, log it, and then extract the listening port from the logs. Or something like that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree, the window to hit the race is small enough that I think it's safe to ignore. Another solution I had in mind was to use unix sockets.

@kruskall kruskall merged commit ef7cd2a into elastic:main Aug 22, 2022
@kruskall kruskall deleted the test/enable-maintest branch August 22, 2022 12:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aws-λ-extension AWS Lambda Extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Followup: rework main tests after refactor has been completed

2 participants