The sentence presents two clauses that show a contrast.
The first clause, The test was challenging, presents a difficulty.
The second clause, I managed to finish it on time, presents a successful outcome despite the difficulty.
We need a connective (conjunction) that introduces a contrast or opposition.
'Since' and 'because' introduce a reason.
'Although' also introduces a contrast, but it is a subordinating conjunction and would typically be used at the beginning of one of the clauses (e.g., Although the test was challenging, I managed to finish...).
'But' is a coordinating conjunction used to connect two independent clauses and show contrast. It fits perfectly in the middle of the sentence.
The test was challenging, but I managed to finish it on time.