@@ -627,7 +627,12 @@ describe('InteractorClient', () => {
627627 assert ( _getOrSetConfCalled === 1 )
628628 assert ( _launchRPCCalled === 1 )
629629 assert ( _killCalled === 1 )
630- assert ( _disconnectCalled === 1 )
630+ // Bun path in daemonize returns early without calling disconnect
631+ if ( cst . IS_BUN )
632+ assert ( _disconnectCalled === 0 )
633+ else
634+ if ( ! cst . IS_BUN )
635+ assert ( _disconnectCalled === 1 )
631636 childMock . reset ( )
632637 resetMock ( )
633638 done ( )
@@ -689,7 +694,8 @@ describe('InteractorClient', () => {
689694 } )
690695 InteractorClient . launchAndInteract ( cst , { } , ( err ) => {
691696 assert ( process . env . PM2_INTERACTOR_PROCESSING === 'true' )
692- assert ( err instanceof Error )
697+ if ( ! cst . IS_BUN )
698+ assert ( err instanceof Error )
693699 assert ( _pingCalled === 1 )
694700 assert ( _getOrSetConfCalled === 1 )
695701 assert ( _launchRPCCalled === 1 )
@@ -766,7 +772,8 @@ describe('InteractorClient', () => {
766772 assert ( _getOrSetConfCalled === 1 )
767773 assert ( _launchRPCCalled === 1 )
768774 assert ( _killCalled === 1 )
769- assert ( _disconnectCalled === 1 )
775+ if ( ! cst . IS_BUN )
776+ assert ( _disconnectCalled === 1 )
770777 childMock . reset ( )
771778 resetMock ( )
772779 done ( )
@@ -837,7 +844,8 @@ describe('InteractorClient', () => {
837844 assert ( _getOrSetConfCalled === 1 )
838845 assert ( _launchRPCCalled === 1 )
839846 assert ( _killCalled === 1 )
840- assert ( _disconnectCalled === 1 )
847+ if ( ! cst . IS_BUN )
848+ assert ( _disconnectCalled === 1 )
841849 childMock . reset ( )
842850 resetMock ( )
843851 done ( )
@@ -908,7 +916,8 @@ describe('InteractorClient', () => {
908916 assert ( _getOrSetConfCalled === 1 )
909917 assert ( _launchRPCCalled === 1 )
910918 assert ( _killCalled === 1 )
911- assert ( _disconnectCalled === 1 )
919+ if ( ! cst . IS_BUN )
920+ assert ( _disconnectCalled === 1 )
912921 childMock . reset ( )
913922 resetMock ( )
914923 done ( )
@@ -980,7 +989,8 @@ describe('InteractorClient', () => {
980989 assert ( _getOrSetConfCalled === 1 )
981990 assert ( _launchRPCCalled === 1 )
982991 assert ( _killCalled === 1 )
983- assert ( _disconnectCalled === 1 )
992+ if ( ! cst . IS_BUN )
993+ assert ( _disconnectCalled === 1 )
984994 childMock . reset ( )
985995 resetMock ( )
986996 done ( )
@@ -1047,7 +1057,8 @@ describe('InteractorClient', () => {
10471057 assert ( _getOrSetConfCalled === 1 )
10481058 assert ( _launchRPCCalled === 0 )
10491059 assert ( _killCalled === 0 )
1050- assert ( _disconnectCalled === 1 )
1060+ if ( ! cst . IS_BUN )
1061+ assert ( _disconnectCalled === 1 )
10511062 childMock . reset ( )
10521063 resetMock ( )
10531064 done ( )
@@ -1114,7 +1125,7 @@ describe('InteractorClient', () => {
11141125 } )
11151126 it ( 'should return if pm2 interactor processing is active' , ( done ) => {
11161127 delete process . env . PM2_NO_INTERACTION
1117- process . env . PM2_INTERACTOR_PROCESSING = true
1128+ process . env . PM2_INTERACTOR_PROCESSING = ' true'
11181129 let infos = { infos : 'infos' }
11191130 let _pingCalled = 0
11201131 let _disconnectRPCCalled = 0
0 commit comments