Skip to content

Commit

Permalink
uncomment cgroup path
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyzha0 committed Aug 26, 2024
1 parent 9d37145 commit 9714541
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,28 +428,28 @@ describe('cgroup opts', () => {
// 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());
expect(getOpenFds()).toStrictEqual(oldFds);
},
});
return new Promise<void>((done) => {
const oldFds = getOpenFds();
let buffer = '';
const pty = new Pty({
command: '/bin/cat',
args: ['/proc/self/cgroup'],
cgroupPath: '/sys/fs/cgroup/cpu/test.slice',
onExit: (err, exitCode) => {
expect(err).toBeNull();
expect(exitCode).toBe(0);
expect(buffer.trim()).toBe(pty.pid.toString());

Check failure on line 441 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:memory:/system.slice/runner-provis…' to be '6017' // Object.is equality - Expected + Received - 6017 + 13:memory:/system.slice/runner-provisioner.service + 12:blkio:/system.slice/runner-provisioner.service + 11:cpuset:/ + 10:pids:/system.slice/runner-provisioner.service + 9:hugetlb:/ + 8:misc:/ + 7:rdma:/ + 6:perf_event:/ + 5:freezer:/ + 4:devices:/system.slice/runner-provisioner.service + 3:net_cls,net_prio:/ + 2:cpu,cpuacct:/test.slice + 1:name=systemd:/system.slice/runner-provisioner.service + 0::/system.slice/runner-provisioner.service ❯ onExit tests/index.test.ts:441:33 ❯ 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. The latest test that might've caused the error is "basic cgroup". It might mean one of the following: - The error was thrown, while Vitest was running this test. - If the error occurred after the test had been completed, this was the last documented test before it was thrown.
expect(getOpenFds()).toStrictEqual(oldFds);
done();
},
});

const readStream = pty.read;
readStream.on('data', (data) => {
buffer = data.toString();
const readStream = pty.read;
readStream.on('data', (data) => {
buffer = data.toString();
});
});
});
console.log(2)
});

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

0 comments on commit 9714541

Please sign in to comment.