This repository was archived by the owner on Mar 26, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,14 +25,12 @@ describe('backups', async () => {
2525 const TABLE_ID = generateId ( ) ;
2626 const BACKUP_ID = generateId ( ) ;
2727
28- const instance = await obtainTestInstance ( ) ;
29-
30- const INSTANCE_ID = instance . id ;
31- const CLUSTER_ID = instance . id ; // The test function uses the same name.
32-
33- const table = instance . table ( TABLE_ID ) ;
34- const cluster = instance . cluster ( INSTANCE_ID ) ;
35- const backup = cluster . backup ( BACKUP_ID ) ;
28+ let instance ;
29+ let INSTANCE_ID ;
30+ let CLUSTER_ID ;
31+ let table ;
32+ let cluster ;
33+ let backup ;
3634
3735 async function createTestBackup ( backupId ) {
3836 const [ backup , operation ] = await cluster . createBackup ( backupId , {
@@ -44,6 +42,15 @@ describe('backups', async () => {
4442 }
4543
4644 before ( async ( ) => {
45+ instance = await obtainTestInstance ( ) ;
46+
47+ INSTANCE_ID = instance . id ;
48+ CLUSTER_ID = instance . id ; // The test function uses the same name.
49+
50+ table = instance . table ( TABLE_ID ) ;
51+ cluster = instance . cluster ( INSTANCE_ID ) ;
52+ backup = cluster . backup ( BACKUP_ID ) ;
53+
4754 await table . create ( ) ;
4855 await table . createFamily ( 'follows' ) ;
4956 await table . insert ( [
Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ async function getStaleInstances() {
5050 * the result.
5151 */
5252async function obtainTestInstance ( ) {
53+ // Note: Do not use this function if it is only inside a describe block.
5354 if ( ! obtainPromise ) {
5455 obtainPromise = createTestInstance ( ) ;
5556 }
You can’t perform that action at this time.
0 commit comments