If a monitor was created with an argument that was not a key-value type, a promise would be rejected outside of the main maxctrl function. Added a test case that covers this and fixed a few other test coverage problems that were present.
		
			
				
	
	
		
			25 lines
		
	
	
		
			695 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			695 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
require('../test_utils.js')()
 | 
						|
 | 
						|
describe("Draining servers", function() {
 | 
						|
    before(startMaxScale)
 | 
						|
 | 
						|
    it('drains server', function() {
 | 
						|
        return doCommand('drain server server1')
 | 
						|
            .should.be.fulfilled
 | 
						|
    })
 | 
						|
 | 
						|
    it('checks server is in maintenance', function() {
 | 
						|
        // The maintenance state isn't set instantly
 | 
						|
        return sleepFor(2000)
 | 
						|
            .then(() => doCommand('api get servers/server1 data.attributes.state'))
 | 
						|
            .should.eventually.have.string("Maintenance")
 | 
						|
    })
 | 
						|
 | 
						|
    it('does not drain non-existent server', function() {
 | 
						|
        return doCommand('drain server not-a-server')
 | 
						|
            .should.be.rejected
 | 
						|
    })
 | 
						|
 | 
						|
    after(stopMaxScale)
 | 
						|
});
 |