Views to use currentlylogged in UID or override via URL
I think what you're going to need to do is clone your display. One display using path 'myproject/test' where you contextual filter uses 'Provide default value' when the filter is not in the URL, with 'User ID from the logged in user' as the type.

The other display will use the path 'myproject/%/test' and since the filter in this case IS provided by the URL, you can do something like 'Show "Page not Found"' if the filter value is not provided by the URL. You'll probably also want to specify a validation criteria using the numeric validator with 'Show "Page not found"' as the action to take if it doesn't validate.