Skip to content

Commit 426f6e5

Browse files
authored
Fix integration test CREATE USER statement (#1069)
The statement was failing in newer database version since minimum password length changed to 8. Adjusting the password in the test fix the issue. The drop user routine was also fixed since it can hide information about the original failure.
1 parent 6e903e7 commit 426f6e5

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

packages/neo4j-driver/test/rx/summary.test.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* See the License for the specific language governing permissions and
1717
* limitations under the License.
1818
*/
19-
import neo4j from '../../src'
19+
import neo4j, { Neo4jError } from '../../src'
2020
// eslint-disable-next-line no-unused-vars
2121
import RxSession from '../../src/session-rx'
2222
// eslint-disable-next-line no-unused-vars
@@ -344,15 +344,23 @@ describe('#integration-rx summary', () => {
344344
runnable = await session.beginTransaction().toPromise()
345345
}
346346

347+
let dropUser = true
348+
347349
try {
348350
await verifySystemUpdates(
349351
runnable,
350-
"CREATE USER foo SET PASSWORD 'bar'",
352+
"CREATE USER foo SET PASSWORD 'barizon1'",
351353
{},
352354
1
353355
)
356+
} catch (e) {
357+
// the user should not be dropped if their creation fails
358+
dropUser = !(e instanceof Neo4jError)
359+
throw e
354360
} finally {
355-
await verifySystemUpdates(runnable, 'DROP USER foo', {}, 1)
361+
if (dropUser) {
362+
await verifySystemUpdates(runnable, 'DROP USER foo', {}, 1)
363+
}
356364
}
357365
}
358366

0 commit comments

Comments
 (0)