Skip to content

Commit a563bee

Browse files
committed
beszel: skip GPU relevant tests and fix racing conditions for darwin
Darwin doesn't support Nvidia and AMD GPU utilities, so such test should be skipped. While building on darwin a racing condition is happening. To solve this, we add the following line to the `internal/hub/systems/system.go` file: ```go defer func() { recover() }(); ```
1 parent 585de0b commit a563bee

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

pkgs/by-name/be/beszel/package.nix

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
stdenv,
23
buildGo126Module,
34
lib,
45
fetchFromGitHub,
@@ -53,6 +54,11 @@ buildGo126Module (finalAttrs: {
5354

5455
vendorHash = "sha256-TVpZbK9V9/GqpVFcjF7QGD5XJJHzRgjVXZOImHQTR1k=";
5556

57+
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
58+
substituteInPlace internal/hub/systems/system.go \
59+
--replace-fail "func (sys *System) StartUpdater() {" "func (sys *System) StartUpdater() { defer func() { recover() }();"
60+
'';
61+
5662
preBuild = ''
5763
mkdir -p internal/site/dist
5864
cp -r ${finalAttrs.webui}/* internal/site/dist
@@ -64,6 +70,17 @@ buildGo126Module (finalAttrs: {
6470
"TestCollectorStartHelpers/nvtop_collector"
6571
"TestApiRoutesAuthentication/GET_/update_-_shouldn't_exist_without_CHECK_UPDATES_env_var"
6672
"TestConfigSyncWithTokens"
73+
]
74+
++ lib.optional stdenv.hostPlatform.isDarwin [
75+
"TestCollectorStartHelpers/nvidia-smi_collector"
76+
"TestCollectorStartHelpers/rocm-smi_collector"
77+
"TestCollectorStartHelpers/tegrastats_collector"
78+
"TestNewGPUManagerPriorityNvtopFallback"
79+
"TestNewGPUManagerPriorityMixedCollectors"
80+
"TestNewGPUManagerPriorityNvmlFallbackToNvidiaSmi"
81+
"TestNewGPUManagerConfiguredCollectorsMustStart"
82+
"TestNewGPUManagerConfiguredNvmlBypassesCapabilityGate"
83+
"TestNewGPUManagerJetsonIgnoresCollectorConfig"
6784
];
6885
in
6986
[

0 commit comments

Comments
 (0)