Use writableEnded to determine whether logStream was closed during test
When asserting whether the logStream is closed, the .closed prop is not sufficient. The prop only becomes true when all the data has been flushed, which probably happens after we want to do the assertion. By using .writableEnded, we can properly check whether the logStream was intentionally closed, as it becomes true as soon as .end() is called. Signed-off-by: ovalice <31350208+ovalice@users.noreply.github.com>
This commit is contained in:
@@ -203,7 +203,7 @@ describeIfKubernetes('KubernetesContainerRunner', () => {
|
||||
|
||||
await containerRunner.runContainer(runOptions);
|
||||
|
||||
expect(logStream.closed).toBe(false);
|
||||
expect(logStream.writableEnded).toBe(false);
|
||||
});
|
||||
|
||||
describe('with namespace test', () => {
|
||||
|
||||
Reference in New Issue
Block a user