Change the approach to find the APM Agent property file in test#144928
Change the approach to find the APM Agent property file in test#144928mamazzol merged 10 commits intoelastic:mainfrom
Conversation
|
Pinging @elastic/es-core-infra (Team:Core/Infra) |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughTests were refactored so the APM properties extractor accepts a JVM 🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
I think I need more context on this one. Why was the old logic wrong? |
Based on the test failure, it still seems to pick up a directory every once in a while (which is surprising, but that's what the message says). So I changed the logic to replicate what we do in Production, so that it's tried and tested |
mark-vieira
left a comment
There was a problem hiding this comment.
Is this a side effect of the CLI launcher changes? If so, what exactly is different here?
I don't think so. This current logic was brought in to fix a similar failure, see #144350 I reproduced that locally by running the test enough times, and it seems to have fixed it, but apparently it's still happening. So I am trying a different approach. |
prdoyle
left a comment
There was a problem hiding this comment.
Sorry, I'm still not quite following. Could you link the that "what we do when deleting the file at startup" so I can follow the reasoning?
| int configIndex = inputArgument.lastIndexOf("=c="); | ||
| if (configIndex > 0) { | ||
| final Path apmConfig = PathUtils.get(inputArgument.substring(configIndex + 3)); | ||
| if (Files.isRegularFile(apmConfig) && apmConfig.getFileName().toString().matches("^\\.elstcapm\\..*\\.tmp$")) { |
There was a problem hiding this comment.
Why did this go back to being a regex?
There was a problem hiding this comment.
Replying to both at the same time, here is the logic I am referring to
This uses the regex so I put it back this way.
There was a problem hiding this comment.
Ah I see! Maybe let's make that a public constant that can be shared in the code rather than duplicating it? That would make the code itself answer both questions!.
…tic#144928) # Conflicts: # muted-tests.yml
Change the approach to find the APM Agent property file in tests to replicate what we do when deleting the file at startup.
Closes: #144357
Closes: #144358