Repository navigation
test(ses): parse the writer-overflow message on a stack of its own - #9097
Conversation
relayRaw_nestingThatParsesButOverflowsTheWriter_isSkippedNotThrown parsed its 10,000-layer message on the test thread and asserted the parse succeeded, but whether mime4j's recursive parser gets that deep depends on the thread's stack. On CI runners it overflows first, so message() is null and the assertion fails: the test has failed on main and on most pull requests since #9066. It now parses on a thread with a 256 MB stack, then relays on the ordinary threads as before, where the writer must still overflow. With -Xss256k the old test fails with expected: not <null> and the new one passes. Signed-off-by: Hector Ventura <hectorvent@gmail.com>
PR Summary by QodoStabilize SES writer-overflow test with a dedicated parse stack
AI Description
Merge Risk
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history |
pgermosen
left a comment
There was a problem hiding this comment.
@hectorvent thanks, this gets at the real cause. The 10,000-layer message is now parsed on a thread with its own 256 MB stack, so assertNotNull(nested.message()) no longer depends on how much stack the test thread happens to have.
The relay itself still runs on the test thread through the synchronous test executor, so what the test checks is unchanged: the writer overflows, doRelayRaw catches the StackOverflowError, and nothing is sent. SmtpRelay is untouched.
Summary
SmtpRelayTest.relayRaw_nestingThatParsesButOverflowsTheWriter_isSkippedNotThrown, added in #9066, has failed on main and on most pull requests since it merged, withexpected: not <null>atSmtpRelayTest.java:344. The test parses a message nested 10,000message/rfc822layers deep on the test thread and asserts the parse succeeds, then checks that the relay skips it when the writer overflows. Whether mime4j's recursive parser gets 10,000 layers deep depends on the stack of the thread it runs on, and on the CI runners the parse overflows first, somessage()is null.The test now parses that message on a thread with a 256 MB stack of its own, then relays it on the ordinary threads as before, where the writer must still overflow.
SmtpRelayis unchanged.Type of change
fix:)feat:)feat!:orfix!:)AWS Compatibility
No behaviour change; test only.
Checklist
./mvnw testpasses locallyTests
Locally (macOS arm64), with
SmtpRelayTest(52 tests) andSesMimeParserTest(3):JAVA_TOOL_OPTIONS=-Xss512kor-Xss256k, with the sameexpected: not <null>as CI.-Xss256k.Checkstyle passes.
Pull requests to rebase onto main once this merges
Their latest CI run fails
relayRaw_nestingThatParsesButOverflowsTheWriter_isSkippedNotThrownin a Build and Test shard. A rerun reuses the old merge with main, so each needs a rebase (or a merge of main) to pick this up:RdsReadReplicaIntegrationTest.createReadReplicaAcceptsAMysqlSourceAndRefusesSqlServerEmrServerlessHiveDockerIntegrationTest.aHiveQueryThatFailsFailsItsRun