Seems that admin_post_{action} does not executing

It’s simply the wrong endpoint. The admin_post_* hook and its admin_post_nopriv_* counterpart is not fired for any admin page with the appropriate action request variable set, it only triggers for requests hitting wp-admin/admin-post.php.

Try https://test.local/wp-admin/admin-post.php?action=test instead.


I should add that using admin-post.php for handling plugin actions might not be appropriate. If you wanted to return the user to their page of origin, then you would need to redirect them and would loose their request data This is terrible UX if, for example, you are returning them because a form field was invalid, as those forms would now be blank.