@@ -15,7 +15,7 @@ import { exec, find, mv, rm, which } from 'shelljs';
15
15
import { TestSession , execCmd } from '@salesforce/cli-plugins-testkit' ;
16
16
import { AsyncCreatable , Env , set , parseJsonMap } from '@salesforce/kit' ;
17
17
import { AnyJson , Dictionary , ensureString , JsonMap , Nullable } from '@salesforce/ts-types' ;
18
- import { AuthInfo , Connection , NamedPackageDir , SfProject , SfdxPropertyKeys } from '@salesforce/core' ;
18
+ import { AuthInfo , Connection , NamedPackageDir , SfProject , SfdxPropertyKeys , StateAggregator } from '@salesforce/core' ;
19
19
import { debug , Debugger } from 'debug' ;
20
20
import { MetadataResolver } from '@salesforce/source-deploy-retrieve' ;
21
21
import { Commands , Result , StatusResult } from './types' ;
@@ -552,9 +552,12 @@ export class SourceTestkit extends AsyncCreatable<SourceTestkit.Options> {
552
552
553
553
private async createConnection ( ) : Promise < Nullable < Connection > > {
554
554
if ( this . orgless ) return ;
555
- return await Connection . create ( {
555
+ StateAggregator . clearInstance ( ) ;
556
+ const conn = await Connection . create ( {
556
557
authInfo : await AuthInfo . create ( { username : this . username } ) ,
557
558
} ) ;
559
+ StateAggregator . clearInstance ( ) ;
560
+ return conn ;
558
561
}
559
562
560
563
private async doGlob ( globs : string [ ] ) : Promise < string [ ] > {
0 commit comments