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

Improve fromTemplate.test.ts to avoid intermittent error on CI #1377

Open
2 tasks done
peter-rr opened this issue Apr 19, 2024 · 8 comments
Open
2 tasks done

Improve fromTemplate.test.ts to avoid intermittent error on CI #1377

peter-rr opened this issue Apr 19, 2024 · 8 comments
Labels
enhancement New feature or request stale

Comments

@peter-rr
Copy link
Member

peter-rr commented Apr 19, 2024

Why do we need this improvement?

There is some error that occurs sporadically when running tests on CI since some days ago, always during the Test NodeJS PR - macos-latest job:

1 failing

1) template
      should install template
        should install template:
    Error: Timeout of 100000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves. (/Users/runner/work/cli/cli/test/integration/bundle/bundle.test.ts)
     at listOnTimeout (node:internal/timers:569:17)
     at processTimers (node:internal/timers:512:7)

Besides, the error displayed points to bundle.test.ts instead of fromTemplate.test.ts, where the error is actually happening.

cc @Souvikns

How will this change help?

This change will avoid the CI fails intermittently for the reason described on the error, so we don't need to trigger manually the GH workflow again to make the CI pass.

Screenshots

No response

How could it be implemented/designed?

The timeout set for that test might be increased or some other change should be applied to the make the test pass.

🚧 Breaking changes

No

👀 Have you checked for similar open issues?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to work on this issue?

None

@peter-rr peter-rr added the enhancement New feature or request label Apr 19, 2024
@peter-rr peter-rr changed the title [FEATURE] Improve fromTemplate.test.ts to avoid intermittent error on CI Improve fromTemplate.test.ts to avoid intermittent error on CI Apr 19, 2024
@Shurtu-gal
Copy link
Collaborator

Can second. Have faced this issue multiple times till now.

@helios2003
Copy link
Contributor

Hello @Shurtu-gal, I am interested in working on this issue. So as suggested in the issue, do I increase the timeout period or do I need to look for a more rigorous fix to the issue?

@Shurtu-gal
Copy link
Collaborator

Hello @Shurtu-gal, I am interested in working on this issue. So as suggested in the issue, do I increase the timeout period or do I need to look for a more rigorous fix to the issue?

Although increasing timeout should work as per theory, it would be better if we solve the underlying problem unless macos requires more time. Also some logs mention failure in installation as well.

ref: https://github.com/asyncapi/cli/actions/runs/8750042993/job/24012793752#step:10:419

@Souvikns
Copy link
Member

Souvikns commented Apr 20, 2024

I think it is happening due to this test specifically. It is testing the --install flag and it installs a new template over the internet which is very slow and flaky.

describe('should install template', () => {
test
.stdout()
.command([
'generate:fromTemplate',
'./test/fixtures/specification.yml',
'./test/fixtures/minimaltemplate',
'--install',
'--force-write',
'--output=./test/docs/7'
])
.it('should install template', (ctx, done) => {
expect(ctx.stdout).to.contain('Template installation started because you passed --install flag.');
cleanup('./test/docs/7');
done();
});
}).timeout(1000000);

@helios2003
Copy link
Contributor

Is there any particular reason though because of which the template generation is happening so slowly only for MacOS?

@smoya
Copy link
Member

smoya commented Jun 3, 2024

This seems like common in other projects, For example: https://github.com/asyncapi/parser-js/actions/runs/9348904713/job/25729559713?pr=999

@Shurtu-gal
Copy link
Collaborator

This seems like common in other projects, For example: https://github.com/asyncapi/parser-js/actions/runs/9348904713/job/25729559713?pr=999

Maybe github is downgrading the mac instances or lowering the quota. Can never know 🤷🏻.

@Amzani Amzani moved this from To Triage to Backlog in CLI - Kanban Jul 5, 2024
Copy link
Contributor

github-actions bot commented Oct 2, 2024

This issue has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.

There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale label Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale
Projects
Status: Backlog
Development

No branches or pull requests

5 participants