https://pantsbuild.org/ logo
#general
Title
# general
c

clean-night-52582

12/09/2020, 11:38 PM
When running
./pants test ::
is there anyway to ensure that a given test gets run first? I have a very slow tests that I would like to ensure is in the first batch. I think it could speed up my test sweet since it runs long after every other test.
w

witty-crayon-22786

12/09/2020, 11:47 PM
there is not currently, but that is a very good idea.
do you have
python_test(.., timeout=..)
values set for those?
j

jolly-midnight-72759

12/10/2020, 12:01 AM
Could test tags be used for this?
(have not read or used)
And of course this assumes all tests are python. 🤔
c

clean-night-52582

12/10/2020, 12:10 AM
I don't have a timeout set since we have some pretty long tests which we are working on cleaning up.
w

witty-crayon-22786

12/10/2020, 12:11 AM
@jolly-midnight-72759: yea. it also assumes that they’re all running in the same process,
c

clean-night-52582

12/10/2020, 12:12 AM
They are python tests, but it's an entire target that is slow. My assumption was pants was creating processes for each test invokation
w

witty-crayon-22786

12/10/2020, 12:12 AM
if the tests had
timeout
values configured, we could run them from longest to shortest… without those we’d have to have some “memory” of how long they took
👍 1
but worth doing most likely.
c

clean-night-52582

12/10/2020, 12:13 AM
I could figure out a timeout that worked for my test since the timeout could be arbitrarily large.
Using
timeout
that way is a cool idea
👍 1
h

hundreds-father-404

12/10/2020, 4:10 AM
Stu, do we then order the await MultiGet in the order we want?
w

witty-crayon-22786

12/10/2020, 4:39 AM
I don't think that that would guarantee it... I think we would need to fiddle a bit deeper, and probably adjust AsyncSemaphore to have a notion of priority
because all sorts of io might happen immediately below the MultiGet and before we actually wait on the AsyncSemaphore for a slot to run
so… yea, i think that it might look like forking tokio’s Semaphore, and swapping out the internal list for a priority queue, basically
it’s possible that they’d accept a patch for it.
👍 1
2 Views