Your test.tcx file is a course file. Are to trying to upload this to your device or to Garmin Connect? Connect does not accept course files. There are a handful of converters that can convert this course to an activity if that's what you're trying to do.
The test.tcx file is a course file and you can only upload history files. If you export the history file from training center (instead of the course file) then you'll be able to upload it to GC. You can also convert a course file to a history file using TCX Converter.
OK well after further research I see it has nothing to do with the suffix of the file ie tcx or history but rather the actual format. a tcx file can be either a course or history file and even then there can be further issues, far from straight forward.