-
Notifications
You must be signed in to change notification settings - Fork 293
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
Adding crash tracking to integration tests #7855
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(smoke-tests): Adding crash tracking
* Excluding J9 * Improving PortUtils to exitCode when process ends abnormally * Improving error reporting when process fails to start Wrapped PortUtils.waitForPortToOpen with exception handling, when exception is raised log file indicating error is added to exception message * Suppressed FileNotException in cleanUpSpec, when process exits abormally since no file is expected and it creates noise * Clarifying exception message * Refining exception suppression, some tests clean-up with test processes still running? * Adding ability to selectively suppress crash tracking * Adding some sanity checks that test processes are up and running as expected * Reworking exception handling logic around verifyLog * Modifying exception handling logic around verifyLog in response to review feedback * When process is alive or exited normally, the exception flows through as is * When process exited abnormally, the exception is wrapped in another exception that indicates the abnormal termination
- Loading branch information
commit e97ef02b4c536bcbbc7068f47a740e3eee5238e6
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,12 @@ abstract class AbstractServerSmokeTest extends AbstractSmokeTest { | |
(0..<numberOfProcesses).each { idx -> | ||
def port = httpPorts[idx] | ||
def process = testedProcesses[idx] | ||
PortUtils.waitForPortToOpen(port, 240, TimeUnit.SECONDS, process) | ||
|
||
try { | ||
PortUtils.waitForPortToOpen(port, 240, TimeUnit.SECONDS, process) | ||
} catch ( Exception e ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding log information to make debug processes failing to start easier for the next person |
||
throw new RuntimeException(e.getMessage() + " - log file " + logFilePaths[idx], e) | ||
} | ||
} | ||
} | ||
|
||
|
@@ -77,7 +82,23 @@ abstract class AbstractServerSmokeTest extends AbstractSmokeTest { | |
if (null != (outputFile = outputs[idx])) { | ||
// check the structures written out to the log, | ||
// and fail the run if anything unexpected was recorded | ||
verifyLog(idx, outputFile) | ||
try { | ||
verifyLog(idx, outputFile) | ||
} catch (FileNotFoundException e) { | ||
if (testedProcesses[idx].isAlive()) { | ||
throw e | ||
} | ||
def exitCode = testedProcesses[idx].exitValue() | ||
if (exitCode == 0) { | ||
throw e | ||
} else { | ||
def logFile = logFilePaths[idx] | ||
// highlight when process exited abnormally, since that may have contributed | ||
// to the log verification failure | ||
throw new RuntimeException( | ||
"Server process exited abnormally - exit code: ${exitCode}; check log file: ${logFile}", e) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made various improvements to the harness itself to make debugging process that exit abnormally easier