Skip to content

Commit d40b1cb

Browse files
authored
Fix FileNotFoundException: ~.maestro/sessions (#1843)
* fix FileNotFoundException: ~.maestro/sessions * update versions and changelog
1 parent 487793c commit d40b1cb

File tree

5 files changed

+33
-15
lines changed

5 files changed

+33
-15
lines changed

CHANGELOG.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,36 @@
11
# Changelog
22

3+
## 1.37.3 - 2024-07-29
4+
5+
### Bug fixes
6+
7+
Fix `FileNotFoundException: ~.maestro/sessions` ([#1843](https://github.com/mobile-dev-inc/maestro/pull/1843))
8+
9+
## 1.37.2 - 2024-07-29
10+
11+
### Bug fixes
12+
13+
- Fix `UnsupportedOperationException: Empty collection can't be reduced` ([#1840](https://github.com/mobile-dev-inc/maestro/pull/1840))
14+
15+
## 1.37.1 - 2024-07-29
16+
17+
### Bug fixes
18+
19+
- Fix crash when `flutter` or `xcodebuild` is not installed ([#1839](https://github.com/mobile-dev-inc/maestro/pull/1839))
20+
321
## 1.37.0 - 2024-07-29
422

523
### New features
624

7-
- **Sharding tests for parallel execution on many devices 🎉** ([#1732](https://github.com/mobile-dev-inc/maestro/pull/1732) by [Kaan](https://github.com/sdfgsdfgd))
25+
- **Sharding tests for parallel execution on many devices 🎉** ([#1732](https://github.com/mobile-dev-inc/maestro/pull/1732) by [Kaan](https://github.com/sdfgsdfgd))
826

927
You can now pass `--shards` argument to `maestro test` to split up your test suite into chunks that run in parallel. If you have feedback or suggestions about this huge new feature, please share them with us in [issue #1818](https://github.com/mobile-dev-inc/maestro/issues/1818).
1028

11-
- **Reports in HTML** ([#1750](https://github.com/mobile-dev-inc/maestro/pull/1750) by [Depa Panjie Purnama](https://github.com/depapp))
29+
- **Reports in HTML** ([#1750](https://github.com/mobile-dev-inc/maestro/pull/1750) by [Depa Panjie Purnama](https://github.com/depapp))
1230

1331
To see it, run `maestro test --format HTML <your-flow.yaml>`
1432

15-
- **Homebrew is back!**
33+
- **Homebrew is back!**
1634

1735
If you prefer to switch your installation of Maestro to use Homebrew:
1836
1. `rm -rf ~/.maestro`

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ android.useAndroidX=true
22
android.enableJetifier=true
33
kotlin.code.style=official
44
GROUP=dev.mobile
5-
VERSION_NAME=1.37.2
5+
VERSION_NAME=1.37.3
66
POM_DESCRIPTION=Maestro is a server-driven platform-agnostic library that allows to drive tests for both iOS and Android using the same implementation through an intuitive API.
77
POM_URL=https://github.com/mobile-dev-inc/maestro
88
POM_SCM_URL=https://github.com/mobile-dev-inc/maestro

maestro-cli/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CLI_VERSION=1.37.2
1+
CLI_VERSION=1.37.3

maestro-cli/src/main/java/maestro/cli/db/KeyValueStore.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ import kotlin.concurrent.write
88
class KeyValueStore(private val dbFile: File) {
99
private val lock = ReentrantReadWriteLock()
1010

11+
init {
12+
dbFile.createNewFile()
13+
}
14+
1115
fun get(key: String): String? = lock.read { getCurrentDB()[key] }
1216

1317
fun set(key: String, value: String) = lock.write {
@@ -40,4 +44,4 @@ class KeyValueStore(private val dbFile: File) {
4044
.joinToString("\n")
4145
)
4246
}
43-
}
47+
}

maestro-cli/src/main/java/maestro/cli/session/SessionStore.kt

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,8 @@ object SessionStore {
99

1010
private val keyValueStore by lazy {
1111
KeyValueStore(
12-
Paths
13-
.get(
14-
System.getProperty("user.home"),
15-
".maestro",
16-
"sessions"
17-
)
12+
dbFile = Paths
13+
.get(System.getProperty("user.home"), ".maestro", "sessions")
1814
.toFile()
1915
.also { it.parentFile.mkdirs() }
2016
)
@@ -23,8 +19,8 @@ object SessionStore {
2319
fun heartbeat(sessionId: String, platform: Platform) {
2420
synchronized(keyValueStore) {
2521
keyValueStore.set(
26-
key(sessionId, platform),
27-
System.currentTimeMillis().toString()
22+
key = key(sessionId, platform),
23+
value = System.currentTimeMillis().toString(),
2824
)
2925

3026
pruneInactiveSessions()
@@ -74,4 +70,4 @@ object SessionStore {
7470
return "${platform}_$sessionId"
7571
}
7672

77-
}
73+
}

0 commit comments

Comments
 (0)