Skip to content

Commit

Permalink
spindown now has a ENTROPY_DONT_KILL env
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiebee committed Oct 21, 2024
1 parent f229cf6 commit ade90aa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Version header format: `[version] Name - year-month-day (entropy-core compatibil
- `configurationSchema` & `auxiliaryDataSchema` to `ProgramInterface`
- added new testing function `jumpStartNetwork(entropy: Entropy) => Promise<undefined>` This function must be called now with a funded key to kick off the network. **It will not work for networks with less then 4 validators**
- added new docker script for four nodes
- `spinNetworkDown` now has an access to the env var `ENTROPY_DONT_KILL` which will preserve the network
the initial though for this was to look at network logs for debugging

### Fixed

Expand Down
4 changes: 4 additions & 0 deletions dev/testing-utils.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ total-block-time: ${headersSenseStart} blocks
}

export async function spinNetworkDown (networkType = 'four-nodes') {
if (!process.env.ENTROPY_DONT_KILL) {
console.warn('$ENTROPY_DONT_KILL is set not spinning the network down')
return false
}
try {
execFileSync('dev/bin/spin-down.sh', [networkType], {
shell: true,
Expand Down
2 changes: 1 addition & 1 deletion tests/end-to-end.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ test('End To End', async (t) => {
await run('network up', spinNetworkUp(networkType))
t.teardown(async () => {
await entropy.close()
if (!process.env.DONT_KILL) await spinNetworkDown(networkType).catch((error) =>
await spinNetworkDown(networkType).catch((error) =>
console.error('Error while spinning network down', error.message)
)
})
Expand Down

0 comments on commit ade90aa

Please sign in to comment.