You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//<8.0.11 does not have MySQL X turned on by default so we will be installing the X Plugin in this if statement.
101
100
//MySQL 5.7.12 introduced the X plugin, but according to https://dev.mysql.com/doc/refman/5.7/en/document-store-setting-up.html, the database needs to be initialised with version 5.7.19.
throw'serverAddress is a string. Should be an object'
102
+
}
103
+
if(serverAddress===null){
104
+
throw'serverAddress is null. Should be an object.'
105
+
}
106
+
91
107
constoptions: ServerOptions={
92
108
arch,
93
109
logLevel: 'LOG',
94
-
port: 3306,
95
-
xPort: 3306,
110
+
xPort: serverAddress.port,// Use a port that is already in use to get X to fail
96
111
xEnabled: 'FORCE',
97
112
initSQLString: 'SELECT 2+2;'
98
113
}
@@ -105,5 +120,10 @@ test('DB creation throws when MySQL fails to initialise and X is force enabled',
105
120
thrown=e
106
121
}
107
122
123
+
awaitnewPromise(resolve=>{
124
+
server.on('close',resolve)
125
+
server.close()
126
+
})
127
+
108
128
expect(thrown).toBe('The port has been retried 10 times and a free port could not be found.\nEither try again, or if this is a common issue, increase options.portRetries.')
0 commit comments