Skip to content

Commit

Permalink
add comments; clarify debug log; tag test case
Browse files Browse the repository at this point in the history
- multiple devices test case is tagged so that it
  will not run with the default test list using
  the [.] syntax
  • Loading branch information
diablodale committed Jun 7, 2023
1 parent d2ddf25 commit 7b17b29
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/xlink/XLinkConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ void XLinkConnection::close() {
if(closed.exchange(true)) return;

constexpr auto RESET_TIMEOUT = 2s;
constexpr auto BOOTUP_SEARCH = 5s;
constexpr auto BOOTUP_SEARCH = 5s; // majority of usb reboots on Windows need more than 5 seconds; this leads to a cascade failure

if(deviceLinkId != -1 && rebootOnDestruction) {
auto previousLinkId = deviceLinkId;
Expand Down Expand Up @@ -428,7 +428,8 @@ void XLinkConnection::initDevice(const DeviceInfo& deviceToInit, XLinkDeviceStat

const bool bootStatus = bootWithPath ? bootAvailableDevice(foundDeviceDesc, pathToMvcmd) : bootAvailableDevice(foundDeviceDesc, mvcmd);
if(!bootStatus) {
throw std::runtime_error("Failed to boot device!");
// this throw will cause an app to crash if not caught by a try/catch around the app's `Device` constructor
throw std::runtime_error("Failed to begin the boot of a device!");
}
}

Expand All @@ -444,7 +445,7 @@ void XLinkConnection::initDevice(const DeviceInfo& deviceToInit, XLinkDeviceStat
// Use "name" as hint only, but might still change
bootedDescInfo.nameHintOnly = true;

logger::debug("Searching for booted device: {}, name used as hint only", bootedDeviceInfo.toString());
logger::debug("Searching for booted device: {}, name/path used as hint only", bootedDeviceInfo.toString());

// Find booted device
deviceDesc_t foundDeviceDesc = {};
Expand Down
2 changes: 1 addition & 1 deletion tests/src/multiple_devices_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ TEST_CASE("Multiple devices with 50 messages each") {
REQUIRE(finished);
}

TEST_CASE("Multiple devices created and destroyed in parallel") {
TEST_CASE("Multiple devices created and destroyed in parallel", "[.][multi_test_devices]") {
constexpr auto TEST_TIMEOUT = 30s;
constexpr auto COLOR_FPS = 30;
constexpr auto MONO_FPS = 30;
Expand Down

0 comments on commit 7b17b29

Please sign in to comment.