Skip to content

Commit a123bb2

Browse files
committed
Merge branch 'master' into miked/CP-1124
2 parents f1627c9 + 7976d86 commit a123bb2

7 files changed

Lines changed: 32 additions & 18 deletions

File tree

changelog.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ and this project adheres to
1010

1111
### Security
1212

13-
Addressed all known, fixable CVEs.
13+
- Addressed all known, fixable CVEs.
14+
15+
### Fixed
16+
17+
- Fixed occasional panic due to a concurrent map read/write during runtime setup.
1418

1519
## 0.48.0
1620

cmd/state-svc/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func main() {
5555
}
5656

5757
if err := events.WaitForEvents(5*time.Second, rollbar.Wait, authentication.LegacyClose, logging.Close); err != nil {
58-
logging.Warning("Failing to wait events")
58+
fmt.Fprintf(os.Stderr, "Warning: failed to wait for events")
5959
}
6060
os.Exit(exitCode)
6161
}()

cmd/state-svc/test/integration/svc_int_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ func (suite *SvcIntegrationTestSuite) TestStartDuplicateErrorOutput() {
157157
func (suite *SvcIntegrationTestSuite) TestSingleSvc() {
158158
suite.OnlyRunForTags(tagsuite.Service)
159159
ts := e2e.New(suite.T(), false)
160-
defer ts.Close()
160+
// TODO: CP-1268 should remove this conditional.
161+
if runtime.GOOS != "windows" || !condition.OnCI() {
162+
defer ts.Close()
163+
}
161164

162165
ts.SpawnCmdWithOpts(ts.SvcExe, e2e.OptArgs("stop"))
163166
time.Sleep(2 * time.Second) // allow for some time to stop the existing available process

pkg/runtime/depot.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ func (d *depot) SetCacheSize(mb int) {
160160
// Artifact metadata comes from the depot's cache, and may not exist for installed artifacts that
161161
// predate the cache.
162162
func (d *depot) Exists(id strfmt.UUID) (bool, *artifactInfo) {
163+
d.mapMutex.Lock()
164+
defer d.mapMutex.Unlock()
165+
163166
if _, ok := d.artifacts[id]; ok {
164167
if artifact, exists := d.config.Cache[id]; exists {
165168
return true, artifact

test/integration/commit_int_test.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func (suite *CommitIntegrationTestSuite) TestCommitAtTimeChange() {
6767
ts := e2e.New(suite.T(), false)
6868
defer ts.Close()
6969

70-
ts.PrepareProjectAndBuildScript("ActiveState-CLI/Commit-Test-A", "7a1b416e-c17f-4d4a-9e27-cbad9e8f5655")
70+
ts.PrepareProjectAndBuildScript("ActiveState-CLI/Commit-Test-A", "2ab50eba-4410-4be2-ba9d-c04ebeda640d")
7171

7272
proj, err := project.FromPath(ts.Dirs.Work)
7373
suite.NoError(err, "Error loading project")
@@ -76,11 +76,11 @@ func (suite *CommitIntegrationTestSuite) TestCommitAtTimeChange() {
7676
suite.Require().NoError(err) // verify validity
7777

7878
// Update top-level at_time variable.
79-
dateTime := "2025-12-05T16:08:55.440Z"
79+
dateTime := "2025-12-11T12:34:56Z"
8080
buildScriptFile := filepath.Join(proj.Dir(), constants.BuildScriptFileName)
8181
contents, err := fileutils.ReadFile(buildScriptFile)
8282
suite.Require().NoError(err)
83-
contents = bytes.Replace(contents, []byte("2023-06-22T21:56:10Z"), []byte(dateTime), 1)
83+
contents = bytes.Replace(contents, []byte("2025-12-10T17:03:26Z"), []byte(dateTime), 1)
8484
suite.Require().NoError(fileutils.WriteFile(buildScriptFile, contents))
8585
suite.Require().Contains(string(fileutils.ReadFileUnsafe(filepath.Join(proj.Dir(), constants.BuildScriptFileName))), dateTime)
8686

@@ -152,14 +152,16 @@ func (suite *CommitIntegrationTestSuite) TestCommitSkipValidation() {
152152
suite.Require().NoError(fileutils.WriteFile(scriptPath, data))
153153

154154
cp := ts.Spawn("commit")
155-
cp.Expect("solver_version in body should be")
155+
cp.Expect("solver_version")
156+
cp.Expect("should be")
156157
cp.ExpectExitCode(1)
157158

158159
cp = ts.Spawn("commit", "--skip-validation")
159160
cp.ExpectExitCode(0)
160161

161162
cp = ts.Spawn("refresh")
162-
cp.Expect("solver_version in body should be")
163+
cp.Expect("solver_version")
164+
cp.Expect("should be")
163165
cp.ExpectExitCode(1)
164166
}
165167

test/integration/package_int_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,12 +679,14 @@ func (suite *PackageIntegrationTestSuite) TestChangeSummary() {
679679
cp.Expect("Successfully set")
680680
cp.ExpectExitCode(0)
681681

682-
ts.PrepareProject("ActiveState-CLI/ChangeSummary", "e2414800-3c35-4ed2-8938-5d36e954ce09")
682+
ts.PrepareProject("ActiveState-CLI/small-python", "66f0259d-5d7a-48ce-a814-fd9db46c5ce6")
683683

684684
cp = ts.Spawn("install", "requests@2.31.0")
685685
cp.Expect("Resolving Dependencies")
686686
cp.Expect("Done")
687-
cp.Expect("Installing requests@2.31.0 includes 4 direct dependencies")
687+
cp.Expect("Installing")
688+
cp.Expect("requests@2.31.0")
689+
cp.Expect("includes 4 direct dependencies")
688690
cp.Expect("├─ ")
689691
cp.Expect("├─ ")
690692
cp.Expect("├─ ")

test/integration/revert_int_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ func (suite *RevertIntegrationTestSuite) TestRevert() {
2424
defer ts.Close()
2525

2626
namespace := "ActiveState-CLI/Revert"
27-
ts.PrepareProject(namespace, "c9444988-2761-4b39-8c4c-eb5fdaaa8dca")
27+
ts.PrepareProject(namespace, "ca615135-ef95-4392-aff5-85b6c7132789")
2828

2929
// Revert the commit that added urllib3.
30-
commitID := "d105e865-d12f-4c42-a1a0-6767590d87da"
30+
commitID := "c44885ee-af0e-4f52-b8ef-63c56fe255c6"
3131
cp := ts.Spawn("revert", commitID)
3232
cp.Expect(fmt.Sprintf("Operating on project %s", namespace))
3333
cp.Expect("You are about to revert the following commit:")
@@ -48,7 +48,7 @@ func (suite *RevertIntegrationTestSuite) TestRevert() {
4848
cp = ts.Spawn("shell", "Revert")
4949
cp.ExpectInput(e2e.RuntimeSourcingTimeoutOpt)
5050
cp.SendLine("python3")
51-
cp.Expect("3.9.15")
51+
cp.Expect("3.11.12")
5252
cp.SendLine("import urllib3")
5353
cp.Expect("No module named 'urllib3'")
5454
cp.SendLine("import argparse")
@@ -63,7 +63,7 @@ func (suite *RevertIntegrationTestSuite) TestRevertRemote() {
6363
ts := e2e.New(suite.T(), false)
6464
defer ts.Close()
6565

66-
ts.PrepareProject("ActiveState-CLI/Revert", "75ae9c67-df55-4a95-be6f-b7975e5bb523")
66+
ts.PrepareProject("ActiveState-CLI/Revert", "ca615135-ef95-4392-aff5-85b6c7132789")
6767

6868
cp := ts.Spawn("config", "set", constants.AsyncRuntimeConfig, "true")
6969
cp.ExpectExitCode(0)
@@ -106,13 +106,13 @@ func (suite *RevertIntegrationTestSuite) TestRevertTo() {
106106
defer ts.Close()
107107

108108
namespace := "ActiveState-CLI/Revert"
109-
ts.PrepareProject(namespace, "c9444988-2761-4b39-8c4c-eb5fdaaa8dca")
109+
ts.PrepareProject(namespace, "ca615135-ef95-4392-aff5-85b6c7132789")
110110

111111
cp := ts.Spawn("config", "set", constants.AsyncRuntimeConfig, "true")
112112
cp.ExpectExitCode(0)
113113

114114
// Revert the commit that added urllib3.
115-
commitID := "d105e865-d12f-4c42-a1a0-6767590d87da"
115+
commitID := "c44885ee-af0e-4f52-b8ef-63c56fe255c6"
116116
cp = ts.Spawn("revert", "--to", commitID)
117117
cp.Expect(fmt.Sprintf("Operating on project %s", namespace))
118118
cp.Expect("You are about to revert to the following commit:")
@@ -153,12 +153,12 @@ func (suite *RevertIntegrationTestSuite) TestJSON() {
153153
ts := e2e.New(suite.T(), false)
154154
defer ts.Close()
155155

156-
ts.PrepareProject("ActiveState-CLI/Revert", "c9444988-2761-4b39-8c4c-eb5fdaaa8dca")
156+
ts.PrepareProject("ActiveState-CLI/Revert", "ca615135-ef95-4392-aff5-85b6c7132789")
157157

158158
cp := ts.Spawn("config", "set", constants.AsyncRuntimeConfig, "true")
159159
cp.ExpectExitCode(0)
160160

161-
cp = ts.Spawn("revert", "--to", "d105e865-d12f-4c42-a1a0-6767590d87da", "-o", "json")
161+
cp = ts.Spawn("revert", "--to", "c44885ee-af0e-4f52-b8ef-63c56fe255c6", "-o", "json")
162162
cp.Expect(`{"current_commit_id":`, e2e.RuntimeSourcingTimeoutOpt)
163163
cp.ExpectExitCode(0)
164164
AssertValidJSON(suite.T(), cp)

0 commit comments

Comments
 (0)