Facebook specifically doesn't allow users to set a "test end" time, but there are levers that you can pull to get results more quickly: audience size, number of message variations, test budget, and test start time.
Each of these options trades off some element of efficiency or performance lift for speed, so we generally recommend reserving these tools for when you're really in a bind.
Number of Message Variations: Each test's total time frame hinges on the time it takes Facebook to approve your message variations. Normally we recommend testing 6-9 message variations, but if you're tight on time, you can aim for 4-6 variations instead.
Test Budget: We generally recommend a budget of $30-$40 for each test. This is typically the minimum spend needed to reach confident results. If you're in a rush you can increase the budget significantly and Facebook will collect information faster.
Test Start Time: To have a test that gathers data quickly, you'll want to start your test when more people are online to view your content. For example, tests started during the day, when people are browsing the internet, gather results more quickly than a test started in the middle of the night when people are sleeping.
Audience Size: By default, we start you with a balanced target audience for each of your pages. You can change it to other audiences as well, but if you reduce the size of your audience you can slow down your test. We recommend targeting an audience of 5-10 million people for faster pacing.
We can't guarantee you'll get results within a specific timeframe, but if you manipulate the above variables you can certainly "compress" the total time it takes to run a test.