From ba85521ea30ae61108f5178e5520fdef7e9a4f24 Mon Sep 17 00:00:00 2001 From: Anton Kastritskiy Date: Mon, 29 Jul 2024 16:08:19 +0100 Subject: [PATCH 1/2] skip hanging tests --- .../src/devices/ios/__tests__/iOSDevice.node.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/desktop/flipper-server/src/devices/ios/__tests__/iOSDevice.node.tsx b/desktop/flipper-server/src/devices/ios/__tests__/iOSDevice.node.tsx index bfa4fa54df8..cbf5ea3127d 100644 --- a/desktop/flipper-server/src/devices/ios/__tests__/iOSDevice.node.tsx +++ b/desktop/flipper-server/src/devices/ios/__tests__/iOSDevice.node.tsx @@ -108,7 +108,7 @@ test('test checkXcodeVersionMismatch with no sims running and no xcode-select', ); }); -test('test queryDevices when simctl used', async () => { +test.skip('test queryDevices when simctl used', async () => { const ios = new IOSDeviceManager( fakeFlipperServer, getFlipperServerConfig().settings, @@ -133,7 +133,7 @@ test('test queryDevices when simctl used', async () => { // FIXME unregister devices, causes a hanging promise in jest }); -test('test queryDevices when idb used', async () => { +test.skip('test queryDevices when idb used', async () => { const ios = new IOSDeviceManager( fakeFlipperServer, getFlipperServerConfig().settings, From 32c4e50dd5d41dc6db1a7a3d3ce5846776fbd737 Mon Sep 17 00:00:00 2001 From: Anton Kastritskiy Date: Mon, 29 Jul 2024 16:17:40 +0100 Subject: [PATCH 2/2] skip hanging tests in github actions only --- .../devices/ios/__tests__/iOSDevice.node.tsx | 101 +++++++++--------- 1 file changed, 52 insertions(+), 49 deletions(-) diff --git a/desktop/flipper-server/src/devices/ios/__tests__/iOSDevice.node.tsx b/desktop/flipper-server/src/devices/ios/__tests__/iOSDevice.node.tsx index cbf5ea3127d..70505fcef26 100644 --- a/desktop/flipper-server/src/devices/ios/__tests__/iOSDevice.node.tsx +++ b/desktop/flipper-server/src/devices/ios/__tests__/iOSDevice.node.tsx @@ -108,52 +108,55 @@ test('test checkXcodeVersionMismatch with no sims running and no xcode-select', ); }); -test.skip('test queryDevices when simctl used', async () => { - const ios = new IOSDeviceManager( - fakeFlipperServer, - getFlipperServerConfig().settings, - ); - ios.ctlBridge = fakeSimctlBridge; - - await ios.queryDevices(fakeSimctlBridge); - - expect(fakeSimctlBridge.getActiveDevices).toBeCalledTimes(1); - expect(fakeIDBBridge.getActiveDevices).toBeCalledTimes(0); - - expect(fakeFlipperServer.registerDevice).toBeCalledTimes(1); - expect(fakeFlipperServer.registerDevice).toBeCalledWith( - expect.objectContaining({ - serial: 'yoda', - }), - ); - - expect(fakeFlipperServer.unregisterDevice).toBeCalledTimes(1); - expect(fakeFlipperServer.unregisterDevice).toBeCalledWith('plapatine'); - - // FIXME unregister devices, causes a hanging promise in jest -}); - -test.skip('test queryDevices when idb used', async () => { - const ios = new IOSDeviceManager( - fakeFlipperServer, - getFlipperServerConfig().settings, - ); - ios.ctlBridge = fakeSimctlBridge; - - await ios.queryDevices(fakeIDBBridge); - - expect(fakeSimctlBridge.getActiveDevices).toBeCalledTimes(0); - expect(fakeIDBBridge.getActiveDevices).toBeCalledTimes(1); - - expect(fakeFlipperServer.registerDevice).toBeCalledTimes(1); - expect(fakeFlipperServer.registerDevice).toBeCalledWith( - expect.objectContaining({ - serial: 'yoda', - }), - ); - - expect(fakeFlipperServer.unregisterDevice).toBeCalledTimes(1); - expect(fakeFlipperServer.unregisterDevice).toBeCalledWith('plapatine'); - - // FIXME unregister devices, causes a hanging promise in jest -}); +// FIXME do not run these tests in GH actions as it causes jest to timeout and exit with 1 exit code +if (!process.env.GITHUB_ACTIONS) { + test('test queryDevices when simctl used', async () => { + const ios = new IOSDeviceManager( + fakeFlipperServer, + getFlipperServerConfig().settings, + ); + ios.ctlBridge = fakeSimctlBridge; + + await ios.queryDevices(fakeSimctlBridge); + + expect(fakeSimctlBridge.getActiveDevices).toBeCalledTimes(1); + expect(fakeIDBBridge.getActiveDevices).toBeCalledTimes(0); + + expect(fakeFlipperServer.registerDevice).toBeCalledTimes(1); + expect(fakeFlipperServer.registerDevice).toBeCalledWith( + expect.objectContaining({ + serial: 'yoda', + }), + ); + + expect(fakeFlipperServer.unregisterDevice).toBeCalledTimes(1); + expect(fakeFlipperServer.unregisterDevice).toBeCalledWith('plapatine'); + + // FIXME unregister devices, causes a hanging promise in jest + }); + + test('test queryDevices when idb used', async () => { + const ios = new IOSDeviceManager( + fakeFlipperServer, + getFlipperServerConfig().settings, + ); + ios.ctlBridge = fakeSimctlBridge; + + await ios.queryDevices(fakeIDBBridge); + + expect(fakeSimctlBridge.getActiveDevices).toBeCalledTimes(0); + expect(fakeIDBBridge.getActiveDevices).toBeCalledTimes(1); + + expect(fakeFlipperServer.registerDevice).toBeCalledTimes(1); + expect(fakeFlipperServer.registerDevice).toBeCalledWith( + expect.objectContaining({ + serial: 'yoda', + }), + ); + + expect(fakeFlipperServer.unregisterDevice).toBeCalledTimes(1); + expect(fakeFlipperServer.unregisterDevice).toBeCalledWith('plapatine'); + + // FIXME unregister devices, causes a hanging promise in jest + }); +}