It seems the Fair Queuing strategy does not work, at least for us.
In the global configuration, we specified the Fair Queuing stragegy, with 5 priorities, the default being 1.
We created two folders, priority1 and priority2.
De defined the global Job Priorities so that priority 1 is assigned to (jobs in) folder priority1, and priority 2 is assigned to (jobs in) folder priority2.
In each folder, we created 4 jobs which simply wait for 30 seconds before terminating in success ("sleep 30" in shell script).
We specified only one executor in order to have jobs queued.
We manually start the 4 jobs in folder priority1 and immediately after, we start the 4 jobs in folder priority2, before the first jobs in folder priority1 terminates.
We expect to have in the queue the jobs from the 2 folders intermixed, which we do.
But if we repeat the experiment a few times, we end up in a state where jobs get queued in the order in which they are started, meaning that the Priority Sorter Plugin does not do its jos properly.
I have attached part of a log produced by the plugin, in which we see that the weight assigned to jobs levels out at 0.00007 and does not increase anymore. I believe this is the reason for the problem.
By looking at the code here https://github.com/rvesse/priority-sorter-plugin/blob/master/src/main/java/jenkins/advancedqueue/sorter/strategy/FQBaseStrategy.java I conclude there the imprecise floating point arithmetic is the culprit.
I wrote this simple Java test class:
It mimmics what I understand the code in the plugin does, and it reproduces the same behavior.