mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	travis: Fix various bugs in new queue worker test.
* Now queue_workers.py sorts queue names and prints them on their own line. Previously it's output was nondeterministic. * Simplified grep strategy for removing the "test" worker.
This commit is contained in:
		@@ -22,5 +22,5 @@ if __name__ == "__main__":
 | 
			
		||||
                        help="Specify which types of queues to list")
 | 
			
		||||
    args = parser.parse_args()
 | 
			
		||||
 | 
			
		||||
    workers = get_active_worker_queues(args.queue_type)
 | 
			
		||||
    print(" ".join(workers))
 | 
			
		||||
    for worker in sorted(get_active_worker_queues(args.queue_type)):
 | 
			
		||||
        print(worker)
 | 
			
		||||
 
 | 
			
		||||
@@ -87,8 +87,9 @@ fi
 | 
			
		||||
echo; echo "Now confirming all the RabbitMQ queue processors are correctly registered!"; echo
 | 
			
		||||
# These hacky shell scripts just extract the sorted list of queue processors, running and expected
 | 
			
		||||
supervisorctl status | cut -f1 -dR | cut -f2- -d: | grep events | cut -f1 -d" " | cut -f3- -d_ | cut -f1 -d- | sort -u > /tmp/running_queue_processors.txt
 | 
			
		||||
for i in `/home/zulip/deployments/current/scripts/lib/queue_workers.py`; do echo $i | grep -v ^test$; done | sort > /tmp/expected_queue_processors.txt
 | 
			
		||||
if diff /tmp/expected_queue_processors.txt /tmp/running_queue_processors.txt >/dev/null; then
 | 
			
		||||
/home/zulip/deployments/current/scripts/lib/queue_workers.py | grep -v ^test$ > /tmp/expected_queue_processors.txt
 | 
			
		||||
if ! diff /tmp/expected_queue_processors.txt /tmp/running_queue_processors.txt >/dev/null; then
 | 
			
		||||
    set +x
 | 
			
		||||
    echo "FAILURE: Runnable queue processors declared in zerver/worker/queue_processors.py "
 | 
			
		||||
    echo "do not match those in puppet/manifests/zulip/base.pp"
 | 
			
		||||
    echo "See http://zulip.readthedocs.io/en/latest/queuing.html for details."
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user