Skip to content

Commit

Permalink
Fixes the stalling container (#1063)
Browse files Browse the repository at this point in the history
  • Loading branch information
atomicgamedeveloper authored Nov 16, 2024
1 parent 0285a90 commit 54dba54
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 19 deletions.
37 changes: 22 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
{
"name": "Digital Twin as a Service",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye",
"image": "mcr.microsoft.com/devcontainers/typescript-node:22-bullseye",
"features": {
"ghcr.io/devcontainers-contrib/features/apt-get-packages:1": {
"ghcr.io/devcontainers-extra/features/apt-get-packages:1": {
"version": "latest",
"clean_ppas": true,
"preserve_apt_list": true,
"packages": "curl graphviz htop net-tools powerline"
},
"ghcr.io/devcontainers/features/common-utils:2": {
"version": "latest",
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
Expand All @@ -19,40 +21,45 @@
"userUid": "1001",
"userGid": "automatic"
},
"ghcr.io/devcontainers-contrib/features/exa:1": {
"ghcr.io/devcontainers-extra/features/exa:1": {
"version": "latest"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "os-provided"
},
"ghcr.io/devcontainers-contrib/features/markdownlint-cli:1": {
"ghcr.io/devcontainers-extra/features/markdownlint-cli:1": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/mkdocs:2": {
"ghcr.io/devcontainers-extra/features/mkdocs:2": {
"version": "latest",
"plugins": "mkdocs-material pymdown-extensions mkdocstrings[crystal,python] mkdocs-monorepo-plugin mkdocs-pdf-export-plugin mkdocs-awesome-pages-plugin python-markdown-math mkdocs-open-in-new-tab mkdocs-with-pdf qrcode"
},
"ghcr.io/devcontainers-contrib/features/nestjs-cli:2": {
"ghcr.io/devcontainers-extra/features/nestjs-cli:2": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/npm-package:1": {
"ghcr.io/devcontainers-extra/features/npm-package:1": {
"package": "madge"
},
"ghcr.io/devcontainers-contrib/features/pipx-package:1": {},
"ghcr.io/devcontainers-contrib/features/poetry:2": {
"ghcr.io/devcontainers-extra/features/pipx-package:1": {
"version": "latest"
},
"ghcr.io/devcontainers-extra/features/poetry:2": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {
"ghcr.io/devcontainers-extra/features/pre-commit:2": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/tmux-apt-get:1": {},
"ghcr.io/devcontainers-contrib/features/typescript:2": {
"ghcr.io/devcontainers-extra/features/tmux-apt-get:1": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/vercel-serve:1": {
"ghcr.io/devcontainers-extra/features/typescript:2": {
"version": "latest"
},
"ghcr.io/devcontainers-contrib/features/zsh-plugins:0": {
"ghcr.io/devcontainers-extra/features/vercel-serve:1": {
"version": "latest"
},
"ghcr.io/devcontainers-extra/features/zsh-plugins:0": {
"version": "latest",
"plugins": "ssh-agent npm zsh-autosuggestions",
"omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions",
"username": "node"
Expand Down Expand Up @@ -105,4 +112,4 @@
]
}
// Execute after login:
// source /usr/share/powerline/bindings/zsh/powerline.zsh
// source /usr/share/powerline/bindings/zsh/powerline.zsh
1 change: 1 addition & 0 deletions servers/lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Install the package with the following commands

```bash
sudo npm install -g @into-cps-association/libms
sudo npm install -g pm2
```

The package on [npmjs](https://registry.npmjs.org) is published
Expand Down
4 changes: 2 additions & 2 deletions servers/lib/test/cloudcmd/cloudcmd.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ describe('cloudcmd test for the application', () => {

await writeFile(`${process.env.LOCAL_PATH}/test.txt`, 'content12345');
// eslint-disable-next-line no-promise-executor-return
await new Promise((resolve) => setTimeout(resolve, 8000));
}, 10000);
await new Promise((resolve) => setTimeout(resolve, 50000)); // This is problematic.
}, 55000);

afterAll(async () => {
await unlink(`${process.env.LOCAL_PATH}/test.txt`);
Expand Down
7 changes: 5 additions & 2 deletions servers/lib/test/e2e/app.e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ describe('End to End test for the application', () => {
await app.init(); // Initialize the application
await app.listen(process.env.PORT);

// Check if the port is available
// eslint-disable-next-line no-promise-executor-return
await new Promise((resolve) => setTimeout(resolve, 4000));
}, 10000);
while (!app.getHttpServer().listening) {
await new Promise((resolve) => setTimeout(resolve, 100));
}
}, 15000);

afterAll(async () => {
await app.close();
Expand Down
3 changes: 3 additions & 0 deletions servers/lib/test/jest-e2e.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,8 @@
"testRegex": ".e2e.spec.ts$",
"transform": {
"^.+\\.(t|j)s$": "ts-jest"
},
"moduleNameMapper": {
"^(\\.\\.?\\/.+)\\.jsx?$": "$1"
}
}

0 comments on commit 54dba54

Please sign in to comment.