Skip to content

Commit

Permalink
Test adding a very long task with a timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardopirovano committed Oct 11, 2022
1 parent 6e1dab2 commit 59b8869
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/init-action.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/init-action.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions src/init-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import {
getThreadsFlagValue,
initializeEnvironment,
Mode,
withTimeout,
} from "./util";

// eslint-disable-next-line import/no-commonjs
Expand Down Expand Up @@ -136,6 +137,14 @@ async function sendSuccessStatusReport(
async function run() {
const startedAt = new Date();
const logger = getActionsLogger();
const longTask = new Promise<void>((resolve) => {
setTimeout(() => {
resolve();
}, 999_999_999);
});
await withTimeout(10, longTask, () => {
logger.info("Long task timed out");
});
initializeEnvironment(Mode.actions, pkg.version);
await checkActionVersion(pkg.version);

Expand Down

0 comments on commit 59b8869

Please sign in to comment.