Skip to content

Commit

Permalink
ahhh
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Aug 26, 2024
1 parent f92a139 commit 9d37145
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,16 +422,21 @@ describe('cgroup opts', () => {
// create a new cgroup
await exec("sudo cgcreate -g 'cpu:/test.slice'")

// Set permissions for the test user
await exec("sudo chown -R $(id -u):$(id -g) /sys/fs/cgroup/cpu/test.slice")

// get the output of ls /sys/fs/cgroup/cpu/test.slice
console.log(await exec("ls /sys/fs/cgroup/cpu/test.slice"))

const oldFds = getOpenFds();
let buffer = '';
console.log(1)
const pty = new Pty({
command: '/bin/cat',
args: ['/proc/self/cgroup'],
// cgroupPath: '/sys/fs/cgroup/cpu/test.slice',
onExit: (err, exitCode) => {
console.log(3)
expect(err).toBeNull();
expect(exitCode).toBe(0);
expect(buffer.trim()).toBe(pty.pid.toString());

Check failure on line 442 in tests/index.test.ts

View workflow job for this annotation

GitHub Actions / Build and test on x86_64-unknown-linux-gnu

Unhandled error

AssertionError: expected '13:misc:/\r\n12:rdma:/\r\n11:cpuset:/…' to be '6073' // Object.is equality - Expected + Received - 6073 + 13:misc:/ + 12:rdma:/ + 11:cpuset:/ + 10:net_cls,net_prio:/ + 9:perf_event:/ + 8:hugetlb:/ + 7:devices:/system.slice/runner-provisioner.service + 6:cpu,cpuacct:/system.slice/runner-provisioner.service + 5:pids:/system.slice/runner-provisioner.service + 4:memory:/system.slice/runner-provisioner.service + 3:freezer:/ + 2:blkio:/system.slice/runner-provisioner.service + 1:name=systemd:/system.slice/runner-provisioner.service + 0::/system.slice/runner-provisioner.service ❯ onExit tests/index.test.ts:442:31 ❯ wrapper.ts:88:35 This error originated in "tests/index.test.ts" test file. It doesn't mean the error was thrown inside the file itself, but while it was running.
Expand All @@ -444,6 +449,7 @@ describe('cgroup opts', () => {
buffer = data.toString();
});
});
console.log(2)
});

describe('setCloseOnExec', () => {
Expand Down

0 comments on commit 9d37145

Please sign in to comment.