Skip to content

Assert expected exceptions are actually thrown - #727

Merged
ok2c merged 1 commit into
apache:masterfrom
sharanggupta:expected-failures-in-future-and-buffer-tests
Oct 29, 2026
Merged

ok2c merged 1 commit into
apache:masterfrom
sharanggupta:expected-failures-in-future-and-buffer-tests

Conversation

@sharanggupta

Copy link
Copy Markdown
Contributor

TestBasicFuture#testFailed, #testAsyncFailed and TestSharedOutputBuffer#testMultithreadingWriteStreamAbort checked the expected exception only inside a catch block, so they still passed if the call returned normally. They now use assertThrows; with BasicFuture.failed() dropping the exception or abort() silently discarding writes, the old versions stay green and the new ones fail.

TestBasicFuture#testFailed, #testAsyncFailed and
TestSharedOutputBuffer#testMultithreadingWriteStreamAbort checked the
ExecutionException only in a catch block, so they still passed if
get() returned normally. Use assertThrows so a missing failure fails
the test.
@ok2c
ok2c merged commit 23de278 into apache:master Oct 29, 2026
11 checks passed
@ok2c

ok2c commented Oct 29, 2026

Copy link
Copy Markdown
Member

Thank you @sharanggupta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants