Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parallel.test-macos-app-sandbox is flaky #54811

Open
anonrig opened this issue Sep 6, 2024 · 2 comments
Open

parallel.test-macos-app-sandbox is flaky #54811

anonrig opened this issue Sep 6, 2024 · 2 comments
Labels
flaky-test Issues and PRs related to the tests with unstable failures on the CI. macos Issues and PRs related to the macOS platform / OSX.

Comments

@anonrig
Copy link
Member

anonrig commented Sep 6, 2024

Test

parallel.test-macos-app-sandbox

Platform

macOS x64

Console output

---
duration_ms: 11506.516
exitcode: 1
severity: fail
stack: |-
  node:assert:126
    throw new AssertionError(obj);
    ^

  AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

  1 !== 0

      at Object.<anonymous> (/Users/iojs/build/workspace/node-test-commit-osx/nodes/osx11-x64/test/parallel/test-macos-app-sandbox.js:47:8)
      at Module._compile (node:internal/modules/cjs/loader:1546:14)
      at Module._extensions..js (node:internal/modules/cjs/loader:1691:10)
      at Module.load (node:internal/modules/cjs/loader:1317:32)
      at Module._load (node:internal/modules/cjs/loader:1127:12)
      at TracingChannel.traceSync (node:diagnostics_channel:315:14)
      at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
      at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:166:5)
      at node:internal/main/run_main_module:30:49 {
    generatedMessage: true,
    code: 'ERR_ASSERTION',
    actual: 1,
    expected: 0,
    operator: 'strictEqual'
  }

  Node.js v23.0.0-pre
...

Build links

Additional information

No response

@anonrig anonrig added the flaky-test Issues and PRs related to the tests with unstable failures on the CI. label Sep 6, 2024
@github-actions github-actions bot added the macos Issues and PRs related to the macOS platform / OSX. label Sep 6, 2024
@aduh95
Copy link
Contributor

aduh95 commented Sep 6, 2024

Cannot reproduce locally on macOS

$ tools/test.py --repeat 9999 test/parallel/test-macos-app-sandbox.js -t 9 
[02:34|% 100|+ 9999|-   0]: Done                          

All tests passed.

@richardlau
Copy link
Member

richardlau commented Sep 6, 2024

It might be related to the disk space issues on macOS (nodejs/build#3887).

See #54802 (comment) for some thoughts -- the assertion failure is from spawning a child codesign process:

It's not impossible, but the test does a free disk space check:

if (!tmpdir.hasEnoughSpace(120 * 1024 * 1024)) {
common.skip('Available disk space < 120MB');
}

and also the copyfiles are not the lines failing (which would suggest the copies were successful?)

// Construct the app bundle and put the node executable in it:
// node_sandboxed.app/
// └── Contents
// ├── Info.plist
// ├── MacOS
// │ └── node
fs.mkdirSync(appBundlePath);
fs.mkdirSync(appBundleContentPath);
fs.mkdirSync(path.join(appBundleContentPath, 'MacOS'));
fs.copyFileSync(
fixtures.path('macos-app-sandbox', 'Info.plist'),
path.join(appBundleContentPath, 'Info.plist'));
fs.copyFileSync(
nodeBinary,
appExecutablePath);

The failing line 47 is spawning codesign but it's swallowing any messages from the process to indicate why it failed:

// Sign the app bundle with sandbox entitlements:
assert.strictEqual(
child_process.spawnSync('/usr/bin/codesign', [
'--entitlements', fixtures.path(
'macos-app-sandbox', 'node_sandboxed.entitlements'),
'--force', '-s', '-',
appBundlePath,
]).status,
0);

Maybe this could be using the utilities from common/child_process (to take advantage of #54622)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flaky-test Issues and PRs related to the tests with unstable failures on the CI. macos Issues and PRs related to the macOS platform / OSX.
Projects
None yet
Development

No branches or pull requests

3 participants