Skip to content

Commit f930429

Browse files
committed
[TEST] Say that the overlapping callbacks are a record, not a contract
The case asserts that two callbacks are inside the handler at once, which is what this client does today. EventHandler does not say whether one request's callbacks can overlap, so a handler written against the interface is not obliged to be re-entrant, and an assertion that reads like a promise is the wrong thing to leave behind. The number stays, because reaching that overlap is the point of the case and a client that began serialising callbacks per operation should be noticed rather than absorbed. The comment now says which of the two it is. 32 tests pass. Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
1 parent 964eed9 commit f930429

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎ext/test/http/curl_http_test.cc‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,12 @@ TEST_F(BasicCurlHttpTests, CancelFromConnectingWhilePollingCompletes)
942942
session->FinishSession();
943943
session_manager->FinishAllSessions();
944944

945+
// Two callbacks are in the handler at once here. That is what this client does today, not
946+
// something EventHandler promises: the interface says nothing about whether one request's
947+
// callbacks can overlap, so a handler written against it is not obliged to be re-entrant. The
948+
// number is pinned because this case exists to reach that overlap, and a client that started
949+
// serialising callbacks per operation would be an improvement worth noticing rather than a
950+
// silent change. Read it as a record of the shape, not as a contract to preserve.
945951
EXPECT_EQ(2, handler->max_concurrent_events_.load(std::memory_order_acquire));
946952
EXPECT_FALSE(handler->got_response_.load(std::memory_order_acquire));
947953
EXPECT_EQ(1, handler->cancelled_from_callback_.load(std::memory_order_acquire));

0 commit comments

Comments
 (0)