Skip to content

Commit

Permalink
Merge pull request #21 from GsDevKit/issue_19
Browse files Browse the repository at this point in the history
Issue #19: it turns out that the `initCrashLog` call in GemServer>>start...
  • Loading branch information
dalehenrich committed Jan 17, 2015
2 parents b5755dc + 3a653c9 commit 9320fab
Show file tree
Hide file tree
Showing 39 changed files with 88 additions and 38 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
private
restartGems: gemServer
gemServer restartGems
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tests
private
runTest: gemServer client: client task: task
[
self startGems: gemServer.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
private
startGems: gemServer
gemServer initCrashLog. "make sure we have a clean slate when starting up"
gemServer startGems
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
tests
testStartRestartStopServer
"just start/restart/stop ... without an http client cannot do much else"

"https://github.com/GsDevKit/gsApplicationTools/issues/19"

| gemServer |
gemServer := GemServer gemServerNamed: self gemServerName.
gemServer tracing: true.
gemServer scriptLogEvent: '---->testStartRestartStopServer' object: gemServer.
[
| portCount |
self startGems: gemServer.
(Delay forSeconds: 3) wait.
portCount := self validatePidFile: gemServer shouldExist: true.
self assert: portCount = gemServer defaultPortOrResourceNameList size.
gemServer restartGems.
(Delay forSeconds: 3) wait.
self validatePidFile: gemServer shouldExist: true ]
ensure: [
self stopGems: gemServer.
(Delay forSeconds: 3) wait.
self validatePidFile: gemServer shouldExist: false ]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
private
validatePidFile: gemServer shouldExist: shouldExist
| portCount |
portCount := 0.
gemServer defaultPortOrResourceNameList
do: [ :defaultPortOrResourceName |
| fileName |
portCount := portCount + 1.
fileName := gemServer gemPidFileName: defaultPortOrResourceName.
ServerFileDirectory
splitName: fileName
to: [ :dirPath :fileName |
| dir x |
dir := ServerFileDirectory on: dirPath.
self assert: (x := dir fileExists: fileName) == shouldExist ] ].
^ portCount
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
"gemClientClass" : "dkh 12/30/2014 12:44",
"gemServerClass" : "dkh 12/26/2014 14:47",
"gemServerName" : "dkh 12/23/2014 13:28",
"restartGems:" : "dkh 01/15/2015 12:22",
"runTest:client:task:" : "dkh 01/01/2015 11:17",
"scheduledTaskList" : "dkh 12/26/2014 18:17",
"setUp" : "dkh 01/09/2015 17:20",
"startGems:" : "dkh 12/23/2014 13:04",
"setUp" : "dkh 12/26/2014 14:47",
"startGems:" : "dkh 01/15/2015 12:35",
"stopGems:" : "dkh 12/23/2014 15:53",
"taskList100" : "dkh 01/02/2015 09:20",
"tearDown" : "dkh 01/06/2015 13:41",
Expand All @@ -21,7 +22,9 @@
"testOutOfMemoryTemp" : "dkh 01/06/2015 13:42",
"testSimple" : "dkh 01/06/2015 13:42",
"testStackOverflow" : "dkh 01/06/2015 13:42",
"testStartRestartStopServer" : "dkh 01/15/2015 12:31",
"testStatus" : "dkh 01/06/2015 13:42",
"testTimeInLondon" : "dkh 01/06/2015 13:42",
"testWarning" : "dkh 01/06/2015 13:42",
"validatePidFile:shouldExist:" : "dkh 01/15/2015 12:25",
"waitForTasks:gemServer:client:" : "dkh 01/01/2015 11:19" } }
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
],
"classvars" : [
],
"commentStamp" : "",
"commentStamp" : "dkh 12/30/2014 12:46",
"instvars" : [
],
"name" : "GemServerRemoteServerParallelProcessingExampleTests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
],
"classvars" : [
],
"commentStamp" : "",
"commentStamp" : "dkh 12/30/2014 12:46",
"instvars" : [
],
"name" : "GemServerRemoteServerSerialProcessingExampleTests",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
],
"classvars" : [
],
"commentStamp" : "",
"commentStamp" : "dkh 12/31/2014 20:50",
"instvars" : [
],
"name" : "GemServerRemoteTaskParallelProcessingExample",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
],
"classvars" : [
],
"commentStamp" : "",
"commentStamp" : "dkh 12/31/2014 20:51",
"instvars" : [
],
"name" : "GemServerRemoteTaskSerialProcessingExample",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
private
startGems: gemServer
gemServer initCrashLog.
gemServer startGems
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"instance" : {
"gemServerName" : "dkh 01/02/2015 11:10",
"runTest:" : "dkh 01/02/2015 11:45",
"setUp" : "dkh 01/09/2015 17:20",
"startGems:" : "dkh 01/02/2015 11:11",
"setUp" : "dkh 01/02/2015 14:45",
"startGems:" : "dkh 01/15/2015 12:34",
"stopGems:" : "dkh 01/02/2015 11:11",
"tearDown" : "dkh 01/06/2015 13:42",
"testSeasideStyleError" : "dkh 01/06/2015 13:42",
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
server specialization
isRunning
^self serverClass isRunning
^self serverClass isRunning
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ accessing
name

name == nil ifTrue: [ ^self serverClass name ].
^name
^name
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
service instance-control
startGems
self initCrashLog.
System commitTransaction
ifFalse: [ self error: 'Commit transaction failed before startGems' ].
self doCommitTransaction
ifFalse: [
| conflicts |
conflicts := System transactionConflicts.
self doAbortTransaction.
self error: 'Commit transaction failed before startGems' ].
self logControlEvent: 'Start Gems: ' , self name.
self portOrResourceNameList
do: [ :portOrResourceName |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"stackReportLimit" : "dkh 12/30/2014 06:46",
"start" : "dkh 01/09/2015 14:16",
"startBasicServerOn:" : "dkh 01/06/2015 15:53",
"startGems" : "dkh 01/06/2015 15:29",
"startGems" : "dkh 01/15/2015 12:35",
"startScriptName" : "dkh 12/04/2014 08:02",
"startScriptPath" : "dkh 12/04/2014 08:02",
"startServerOn:" : "dkh 01/06/2015 15:49",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
block: anObject

block := anObject
block := anObject
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
nativeProcess: anObject

nativeProcess := anObject
nativeProcess := anObject
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
nativeProcess

^nativeProcess
^nativeProcess
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
nativeSemaphore: anObject

nativeSemaphore := anObject
nativeSemaphore := anObject
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
portableProcess: anObject

portableProcess := anObject
portableProcess := anObject
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
portableProcess

^portableProcess
^portableProcess
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
accessing
portableSemaphore: anObject

portableSemaphore := anObject
portableSemaphore := anObject
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
gem server querying
gemServerNamed: aString
^self singleton serverNamed: aString
^self singleton serverNamed: aString
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
gem server querying
gemServerNames
^self singleton names asSortedCollection
^self singleton names asSortedCollection
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
instance creation
new
^self singleton
^self singleton
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
registration
removeGemServerNamed: aName
self singleton removeServer: aName
.
.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
gem server querying
serverGems
^self singleton servers
^self singleton servers
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
gem server querying
serversOnPort: aPortNumber
^self singleton serversOnPort: aPortNumber
^self singleton serversOnPort: aPortNumber
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ accessing
singleton

Singleton isNil ifTrue: [self initSingleton].
^Singleton
^Singleton
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ addServer: aServer
(self serverNamed: aServer name) notNil
ifTrue: [^Error error: 'Server with that name already exists!'].

self servers add: aServer
self servers add: aServer
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
other
names

^self servers collect:[:each | each name].
^self servers collect:[:each | each name].
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ other
removeServer: aName
|server|
server :=self serverNamed:aName.
server == nil ifFalse:[ servers remove: server]
server == nil ifFalse:[ servers remove: server]
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
other
serverClasses

^self servers collect:[:each | each serverClass].
^self servers collect:[:each | each serverClass].
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
other
serverNamed: aString
^self servers detect:[:each | each name = aString] ifNone:[nil]
^self servers detect:[:each | each name = aString] ifNone:[nil]
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
other
servers
^servers
^servers
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
other
serversOfClass: aClassName
^servers select: [:each | each serverClass name = aClassName]
^servers select: [:each | each serverClass name = aClassName]

Large diffs are not rendered by default.

0 comments on commit 9320fab

Please sign in to comment.