Skip to content

Commit 30c83a6

Browse files
committed
Fix tests [1] --filter=[core] --verbose
1 parent 2d9c878 commit 30c83a6

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

core-tests/src/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ int main(int argc, char **argv) {
2222
swoole_set_trace_flags(SW_TRACE_ALL);
2323
#endif
2424

25+
if (getenv("VERBOSE") != nullptr && std::string(getenv("VERBOSE")) == "0") {
26+
swoole_set_log_level(SW_LOG_INFO);
27+
}
28+
2529
::testing::InitGoogleTest(&argc, argv);
2630
int retval = RUN_ALL_TESTS();
2731

core-tests/src/server/server.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2266,11 +2266,14 @@ static void test_clean_worker(Server::Mode mode) {
22662266
};
22672267

22682268
serv.onStart = [port, &ac, counter](Server *_serv) {
2269-
swoole_timer_after(50, [port, _serv, &ac, counter](TIMER_PARAMS) {
2269+
swoole_timer_after(100, [port, _serv, &ac, counter](TIMER_PARAMS) {
22702270
ac.on_connect([&](AsyncClient *ac) { ac->send(SW_STRL(TEST_STR)); });
22712271

2272-
ac.on_close(
2273-
[_serv](AsyncClient *ac) { swoole_timer_after(50, [_serv](TIMER_PARAMS) { _serv->shutdown(); }); });
2272+
ac.on_close([_serv](AsyncClient *ac) {
2273+
swoole_timer_after(100, [_serv, ac](TIMER_PARAMS) {
2274+
_serv->shutdown();
2275+
});
2276+
});
22742277

22752278
ac.on_error([](AsyncClient *ac) {});
22762279

src/server/worker.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ bool Server::kill_worker(int worker_id, bool wait_reactor) {
359359
return send_to_worker_from_worker(get_worker(worker_id), &event, sizeof(event), SW_PIPE_MASTER) != -1;
360360
}
361361

362-
if (current_worker && worker_id == current_worker->id && !wait_reactor) {
362+
if (current_worker && (WorkerId) worker_id == current_worker->id && !wait_reactor) {
363363
if (swoole_event_is_available()) {
364364
swoole_event_defer([](void *data) { sw_reactor()->running = false; }, nullptr);
365365
}

0 commit comments

Comments
 (0)