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

test: fix the unstable for windows #5195

Merged
merged 1 commit into from
May 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 4 additions & 8 deletions test/lib/core/logger.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ describe('test/lib/core/logger.test.js', () => {
mm.env('local');
app = utils.cluster('apps/logger');
app
// .debug()
// .debug()
.coverage(false)
.expect('stdout', /agent info/)
.expect('stdout', /app info/)
Expand All @@ -171,20 +171,16 @@ describe('test/lib/core/logger.test.js', () => {
});

it('agent and app error should output to common-error.log', done => {
// unstable on Windows, skip it
// https://github.com/eggjs/egg/runs/7977866117?check_suite_focus=true
if (process.platform === 'win32') {
return done();
}
const baseDir = utils.getFilepath('apps/logger');
mm.env('default');
mm(process.env, 'EGG_LOG', 'none');
mm(process.env, 'EGG_HOME', baseDir);
app = utils.cluster('apps/logger');
app
// .debug()
// .debug()
.coverage(false)
.end(err => {
.end(async err => {
await utils.sleep(1000);
assert(!err);
const content = fs.readFileSync(path.join(baseDir, 'logs/logger/common-error.log'), 'utf8');
assert(content.includes('nodejs.Error: agent error'));
Expand Down